Mercurial > lcfOS
comparison python/thex.py @ 190:65dda7e7e8bd
Disable test with qt
author | Windel Bouwman |
---|---|
date | Sat, 25 May 2013 15:15:42 +0200 |
parents | python/testhexedit.py@5334b86ac1db |
children | ca1ea402f6a1 |
comparison
equal
deleted
inserted
replaced
189:5334b86ac1db | 190:65dda7e7e8bd |
---|---|
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 class HexTest(unittest.TestCase): | |
9 def setUp(self): | |
10 self.app = QApplication(sys.argv) | |
11 self.ui = hexedit.HexEditor() | |
12 self.bv = self.ui.he.bv | |
13 # Provide some random data: | |
14 self.bv.Data = bytearray(range(10)) * 8 + b'x' | |
15 def testOpenButton(self): | |
16 QTest.mouseClick(self.bv, Qt.LeftButton) | |
17 self.assertEqual(self.bv.CursorPosition, 161) | |
18 QTest.keyClick(self.bv, Qt.Key_Left) | |
19 self.assertEqual(self.bv.CursorPosition, 160) | |
20 QTest.keyClick(self.bv, Qt.Key_Up) | |
21 self.assertEqual(self.bv.CursorPosition, 128) | |
22 | |
23 if __name__ == '__main__': | |
24 unittest.main() |