comparison test/testhexedit.py @ 351:62803b073d11

Add conditional qt5 test
author Windel Bouwman
date Sat, 08 Mar 2014 16:46:51 +0100
parents 11c5a8a70c02
children
comparison
equal deleted inserted replaced
350:2b02bd286fe9 351:62803b073d11
1 import sys 1 import sys
2 import unittest 2 import unittest
3 3
4 import hexedit 4 try:
5 #import ide 5 import hexedit
6 #import ide
6 7
7 from PyQt5.QtWidgets import QApplication 8 from PyQt5.QtWidgets import QApplication
8 from PyQt5.QtTest import QTest 9 from PyQt5.QtTest import QTest
9 from PyQt5.QtCore import Qt 10 from PyQt5.QtCore import Qt
11 skip_it = False
12 except ImportError as e:
13 skip_it = True
10 14
11 15
12 class HexEditorTest(unittest.TestCase): 16 class HexEditorTest(unittest.TestCase):
13 def setUp(self): 17 def setUp(self):
18 if skip_it:
19 self.skipTest('No qt5')
20 return
14 self.app = QApplication(sys.argv) 21 self.app = QApplication(sys.argv)
15 self.ui = hexedit.HexEditor() 22 self.ui = hexedit.HexEditor()
16 self.bv = self.ui.he.bv 23 self.bv = self.ui.he.bv
17 # Provide some random data: 24 # Provide some random data:
18 self.bv.Data = bytearray(range(10)) * 8 + b'x' 25 self.bv.Data = bytearray(range(10)) * 8 + b'x'