comparison test/gui/testhexedit.py @ 287:1c7c1e619be8

File movage
author Windel Bouwman
date Thu, 21 Nov 2013 11:57:27 +0100
parents python/thex.py@ca1ea402f6a1
children
comparison
equal deleted inserted replaced
286:d9df72971cbf 287:1c7c1e619be8
1 import unittest
2 import hexedit
3 from PyQt4.QtGui import QApplication
4 from PyQt4.QtTest import QTest
5 from PyQt4.QtCore import Qt
6 import sys
7
8
9 class HexTest(unittest.TestCase):
10 def setUp(self):
11 self.app = QApplication(sys.argv)
12 self.ui = hexedit.HexEditor()
13 self.bv = self.ui.he.bv
14 # Provide some random data:
15 self.bv.Data = bytearray(range(10)) * 8 + b'x'
16
17 def tearDown(self):
18 self.app.processEvents()
19 self.app.quit()
20
21 def testOpenButton(self):
22 self.assertEqual(0, self.bv.CursorPosition)
23 #QTest.mouseClick(self.bv, Qt.LeftButton)
24 self.assertEqual(161, self.bv.CursorPosition)
25 QTest.keyClick(self.bv, Qt.Key_Left)
26 self.assertEqual(160, self.bv.CursorPosition)
27 QTest.keyClick(self.bv, Qt.Key_Up)
28 self.assertEqual(128, self.bv.CursorPosition)
29
30
31 if __name__ == '__main__':
32 unittest.main()