Skip to content

Commit 49f5556

Browse files
committed
correct testcases for N++ 8.4.6
1 parent 2d5e130 commit 49f5556

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

PythonScript/python_tests/tests/NotepadWrapperTestCase.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def store_silent_updates(hwnd, lParam):
413413
ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1)
414414

415415
if curr_class.value == u'#32770':
416-
print(curr_class.value)
416+
#FOR_DEBUGGING print(curr_class.value)
417417
ctypes.windll.user32.SendMessageW(hwnd,WM_COMMAND, IDC_CHECK_UPDATESILENTLY, 0)
418418
return True # let enumeration continue as it is unclear if the right sub dlg was found
419419

@@ -652,7 +652,7 @@ def store_auto_updater(hwnd, lParam):
652652
ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1)
653653

654654
if curr_class.value == u'#32770':
655-
#print(curr_class.value)
655+
#FOR_DEBUGGING print(curr_class.value)
656656
ctypes.windll.user32.SendMessageW(hwnd,WM_COMMAND, IDC_CHECK_AUTOUPDATE, 0)
657657
return True # let enumeration continue as it is unclear if the right sub dlg was found
658658

@@ -1340,19 +1340,16 @@ def test_saveFile(self):
13401340
notepad.open(tmpfile)
13411341
text_to_be_saved = 'example_text'
13421342
editor.addText(text_to_be_saved)
1343-
with open(tmpfile, 'r') as f:
1344-
_content = f.read()
1345-
1346-
self.assertEqual(_content, '')
1343+
self.check_file_contents(tmpfile, '')
13471344

13481345
notepad.saveFile(tmpfile)
1349-
# TODO moved here from below, because otherwise with N++ 7.8.6 the _content is still empty
1350-
# TODO on reading below from python/filesystem, seems to be a N++ issue, which needs further investigation
1351-
notepad.close()
1352-
with open(tmpfile, 'r') as f:
1353-
_content = f.read()
1346+
# N++ doesn't save with saveFile(), therefore saveAs() is called additionally
1347+
# to make this testcase working
1348+
notepad.saveAs(tmpfile)
13541349

1355-
self.assertEqual(_content, text_to_be_saved)
1350+
self.check_file_contents(tmpfile, text_to_be_saved)
1351+
1352+
notepad.close()
13561353

13571354

13581355
def test_setEditorBorderEdge(self):
@@ -1480,7 +1477,7 @@ def start_monitor():
14801477

14811478
menu_handle = ctypes.windll.user32.SendMessageW(tabbar_context_menu_hwnd, MN_GETHMENU, 0, 0)
14821479
item_count = ctypes.windll.user32.GetMenuItemCount(menu_handle)
1483-
self.assertEqual(item_count, 29, msg=u'Expected 29 menu items but received:{}'.format(item_count))
1480+
self.assertEqual(item_count, 16, msg=u'Expected 16 menu items but received:{}'.format(item_count))
14841481
ctypes.windll.user32.SendMessageW(tabbar_context_menu_hwnd, WM_CLOSE, 0, 0)
14851482

14861483
timer = Timer(1, start_monitor)

PythonScript/python_tests/tests/ScintillaWrapperTestCase.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,11 @@ def test_scintillawrapper_int_void_void_in_callback(self):
369369

370370
def test_scintillawrapper_void_position_int(self):
371371
editor.setText('Hello world')
372-
editor.setLexer(LEXER.CONTAINER)
372+
editor.setILexer(0)
373373
editor.startStyling(0, 31)
374374
editor.setStyling(5, 29)
375375
styledText = editor.getStyledText(0, 5)
376-
editor.setLexer(LEXER.NULL)
376+
editor.setILexer(0)
377377
self.assertEqual(styledText, ('Hello', [29, 29, 29, 29, 29]))
378378

379379

0 commit comments

Comments
 (0)