def test_scintillawrapper_void_int_cells_in_callback(self): editor.write('Hi') editor.setText('') editor.callback(lambda args: self.callback_scintillawrapper_void_int_cells(args), [SCINTILLANOTIFICATION.SAVEPOINTREACHED]) editor.setSavePoint() self.poll_for_callback() self.assertEqual(self.callbackCalled, True)
def test_scintillawrapper_void_void_int_in_callback(self): notepad.outputDebugString('test_scintillawrapper_void_void_int_in_callback') editor.write('test'); editor.callback(lambda args: self.callback_scintillawrapper_void_void_int(args), [SCINTILLANOTIFICATION.SAVEPOINTREACHED]) editor.setSavePoint() self.poll_for_callback() self.assertEqual(self.callbackCalled, True)
def test_scintillawrapper_void_position_string_in_callback(self): editor.callback( lambda args: self.callback_scintillawrapper_void_position_string( args), [SCINTILLANOTIFICATION.SAVEPOINTREACHED]) editor.setSavePoint() self.poll_for_callback() self.assertEqual(self.callbackCalled, True)
def test_scintillawrapper_int_void_textrange_in_callback(self): notepad.setLangType(LANGTYPE.XML) editor.write('<test attrib="unit" />') time.sleep(0.1) # lexing and threading don't seem to mix editor.callback(lambda args: self.callback_scintillawrapper_int_void_textrange(args), [SCINTILLANOTIFICATION.SAVEPOINTREACHED]) editor.setSavePoint() self.poll_for_callback() self.assertEqual(self.callbackCalled, True)
def test_scintillawrapper_int_int_string_in_callback(self): editor.write('ABC This is a some ABC text we are going to search') editor.callback( lambda args: self.callback_scintillawrapper_int_int_string(args), [SCINTILLANOTIFICATION.SAVEPOINTREACHED]) editor.setSavePoint() self.poll_for_callback() self.assertEqual(self.callbackCalled, True)
def tearDown(self): editor.setSavePoint() notepad.close()
# -*- coding: utf-8 -*-
def tearDown(self): notepad.clearCallbacks() editor.clearCallbacks() editor.setSavePoint() notepad.close()