~mapclient.devs/mapclient/stable

« back to all changes in this revision

Viewing changes to tests/tools/test_pmr_gui.py

  • Committer: musculoskeletal
  • Date: 2014-06-25 05:38:05 UTC
  • mfrom: (1.6.35 testing)
  • Revision ID: musculoskeletal@bioeng1033-20140625053805-jkqhi5oq74vmlntl
Merging testing into stable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'''
 
2
MAP Client, a program to generate detailed musculoskeletal models for OpenSim.
 
3
    Copyright (C) 2012  University of Auckland
 
4
    
 
5
This file is part of MAP Client. (http://launchpad.net/mapclient)
 
6
 
 
7
    MAP Client is free software: you can redistribute it and/or modify
 
8
    it under the terms of the GNU General Public License as published by
 
9
    the Free Software Foundation, either version 3 of the License, or
 
10
    (at your option) any later version.
 
11
 
 
12
    MAP Client is distributed in the hope that it will be useful,
 
13
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
    GNU General Public License for more details.
 
16
 
 
17
    You should have received a copy of the GNU General Public License
 
18
    along with MAP Client.  If not, see <http://www.gnu.org/licenses/>..
 
19
'''
 
20
import unittest, sys
 
21
 
 
22
from PySide import QtGui
 
23
 
 
24
from mapclient.settings import info
 
25
 
 
26
DISABLE_GUI_TESTS = True
 
27
 
 
28
app = QtGui.QApplication('testpmr')
 
29
app.setOrganizationDomain(info.ORGANISATION_DOMAIN)
 
30
app.setOrganizationName(info.ORGANISATION_NAME)
 
31
app.setApplicationName(info.APPLICATION_NAME)
 
32
app.setApplicationVersion(info.ABOUT['version'])
 
33
 
 
34
 
 
35
class PMRSearchDialogTestCase(unittest.TestCase):
 
36
 
 
37
    def setUp(self):
 
38
        pass
 
39
 
 
40
 
 
41
    def tearDown(self):
 
42
        pass
 
43
 
 
44
    if sys.version < '2.7.0':
 
45
        @unittest.skipIf(DISABLE_GUI_TESTS, 'GUI tests are disabled')
 
46
        def testPMRSearchDialog(self):        
 
47
            from mapclient.tools.pmr.pmrsearchdialog import PMRSearchDialog
 
48
            dlg = PMRSearchDialog()
 
49
            dlg.setModal(True)
 
50
            if dlg.exec_():
 
51
                ws = dlg.getSelectedWorkspace()
 
52
                print('the winner has selected:')
 
53
                print(ws)
 
54
            
 
55
            
 
56
if __name__ == "__main__":
 
57
    #import sys;sys.argv = ['', 'Test.testName']
 
58
    unittest.main()