comparison test/testhexedit.py @ 343:11c5a8a70c02 devel

Fix ide
author Windel Bouwman
date Sat, 01 Mar 2014 16:27:52 +0100
parents test/gui/testhexedit.py@1c7c1e619be8
children 62803b073d11
comparison
equal deleted inserted replaced
342:86b02c98a717 343:11c5a8a70c02
1 import sys
2 import unittest
3
4 import hexedit
5 #import ide
6
7 from PyQt5.QtWidgets import QApplication
8 from PyQt5.QtTest import QTest
9 from PyQt5.QtCore import Qt
10
11
12 class HexEditorTest(unittest.TestCase):
13 def setUp(self):
14 self.app = QApplication(sys.argv)
15 self.ui = hexedit.HexEditor()
16 self.bv = self.ui.he.bv
17 # Provide some random data:
18 self.bv.Data = bytearray(range(10)) * 8 + b'x'
19
20 def tearDown(self):
21 self.app.processEvents()
22 self.app.quit()
23
24 def tstOpenFile(self):
25 pass
26 #self.ui.actionOpen.trigger()
27 #w = self.app.activeWindow()
28 #print(w)
29 #QTest.keyClick(self.ui, Qt.Key_Escape)
30
31 def tstDataInView(self):
32 self.assertEqual(0, self.bv.CursorPosition)
33 QTest.mouseClick(self.bv, Qt.LeftButton)
34 self.assertEqual(154, self.bv.CursorPosition)
35 QTest.keyClick(self.bv, Qt.Key_Left)
36 self.assertEqual(153, self.bv.CursorPosition)
37 QTest.keyClick(self.bv, Qt.Key_Up)
38 self.assertEqual(137, self.bv.CursorPosition)
39
40
41 if __name__ == '__main__':
42 unittest.main()