-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdevTestUI.py
47 lines (31 loc) · 1.13 KB
/
devTestUI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from filesystem import P4File, P4Change, removeDupes
from baseMelUI import *
from devTest import TEST_CASES, runTestCases
class DevTestLayout(MelVSingleStretchLayout):
def __init__( self, parent, *a, **kw ):
MelVSingleStretchLayout.__init__( self, parent, *a, **kw )
self.UI_tests = UI_tests = MelObjectScrollList( self, ams=True )
self.UI_run = UI_run = MelButton( self, l='Run Tests', c=self.on_test )
for testCls in TEST_CASES:
UI_tests.append( testCls )
self.setStretchWidget( UI_tests )
self.layout()
### EVENT HANDLERS ###
def on_test( self, *a ):
'''
run the selected tests - the modules are reloaded before running the tests so
its easy to iterate when writing the tests
'''
runTestCases( self.UI_tests.getSelectedItems() )
class DevTestWindow(BaseMelWindow):
WINDOW_NAME = 'devTestWindow'
WINDOW_TITLE = 'Maya Devtest Runner'
DEFAULT_MENU = None
DEFAULT_SIZE = 300, 300
FORCE_DEFAULT_SIZE = True
HELP_MENU = 'devTest', '[email protected]', None
def __init__( self ):
BaseMelWindow.__init__( self )
DevTestLayout( self )
self.show()
#end