Trees | Indices | Help |
|
---|
|
1 ############################################################################### 2 # # 3 # Copyright (C) 2006-2014 Edward d'Auvergne # 4 # # 5 # This file is part of the program relax (http://www.nmr-relax.com). # 6 # # 7 # This program 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 # This program 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 this program. If not, see <http://www.gnu.org/licenses/>. # 19 # # 20 ############################################################################### 21 22 # Package docstring. 23 """The relax GUI tests.""" 24 25 # Python module imports. 26 from re import search 27 from unittest import TestSuite 28 import wx 29 30 # relax module imports. 31 from lib.errors import RelaxError 32 33 # relax GUI test module imports. 34 from test_suite.gui_tests.bmrb import Bmrb 35 from test_suite.gui_tests.bruker import Bruker 36 from test_suite.gui_tests.consistency_tests import Ct 37 from test_suite.gui_tests.dead_uf_pages import Dead_uf_pages 38 from test_suite.gui_tests.frame_order import Frame_order 39 from test_suite.gui_tests.general import General 40 from test_suite.gui_tests.interatomic import Interatomic 41 from test_suite.gui_tests.jw_mapping import Jw_mapping 42 from test_suite.gui_tests.model_free import Mf 43 from test_suite.gui_tests.n_state_model import N_state_model 44 from test_suite.gui_tests.noe import Noe 45 from test_suite.gui_tests.pipes import Pipes 46 from test_suite.gui_tests.relax_disp import Relax_disp 47 from test_suite.gui_tests.rx import Rx 48 from test_suite.gui_tests.state import State 49 from test_suite.gui_tests.test_user_functions import User_functions 50 from test_suite.relax_test_loader import RelaxTestLoader as TestLoader 51 52 53 __all__ = ['bmrb', 54 'consistency_tests', 55 'gui', 56 'interatomic', 57 'jw_mapping', 58 'model_free', 59 'n_state_model', 60 'noe', 61 'pipes', 62 'rx', 63 'state'] 64 6567 """Class for executing all of the GUI tests.""" 6814370 """Run the GUI tests. 71 72 The GUI test list should be something like ['N_state_model.test_stereochem_analysis']. The first part is the imported test case class, the second is the specific test. 73 74 75 @keyword tests: The list of GUI tests to preform. 76 @type tests: list of str 77 @keyword runner: A test runner such as TextTestRunner. For an example of how to write a test runner see the python documentation for TextTestRunner in the python source. 78 @type runner: Test runner instance (TextTestRunner, BaseGUITestRunner subclass, etc.) 79 """ 80 81 # Create an array of test suites (add your new TestCase classes here). 82 suite_array = [] 83 84 # Specific tests. 85 for test in tests: 86 # The entire test class. 87 if not search('\.', test): 88 # Check that the class exists. 89 if test not in globals(): 90 raise RelaxError("The GUI test class '%s' does not exist." % test) 91 92 # The uninstantiated class object. 93 obj = globals()[test] 94 95 # Add the tests. 96 suite_array.append(TestLoader().loadTestsFromTestCase(obj)) 97 98 # Single system test. 99 else: 100 # Split. 101 row = test.split('.') 102 103 # Check. 104 if len(row) != 2: 105 raise RelaxError("The GUI test '%s' is not in the correct format. It should consist of the test case class, a dot, and the specific test." % test) 106 107 # Unpack. 108 class_name, test_name = row 109 110 # Get the class object. 111 obj = globals()[class_name] 112 113 # Add the test. 114 suite_array.append(TestLoader().loadTestsFromNames([test_name], obj)) 115 116 # All tests. 117 if not tests: 118 suite_array.append(TestLoader().loadTestsFromTestCase(Bmrb)) 119 suite_array.append(TestLoader().loadTestsFromTestCase(Bruker)) 120 suite_array.append(TestLoader().loadTestsFromTestCase(Ct)) 121 suite_array.append(TestLoader().loadTestsFromTestCase(Dead_uf_pages)) 122 suite_array.append(TestLoader().loadTestsFromTestCase(Frame_order)) 123 suite_array.append(TestLoader().loadTestsFromTestCase(General)) 124 suite_array.append(TestLoader().loadTestsFromTestCase(Interatomic)) 125 suite_array.append(TestLoader().loadTestsFromTestCase(Jw_mapping)) 126 suite_array.append(TestLoader().loadTestsFromTestCase(Mf)) 127 suite_array.append(TestLoader().loadTestsFromTestCase(N_state_model)) 128 suite_array.append(TestLoader().loadTestsFromTestCase(Noe)) 129 suite_array.append(TestLoader().loadTestsFromTestCase(Pipes)) 130 suite_array.append(TestLoader().loadTestsFromTestCase(Relax_disp)) 131 suite_array.append(TestLoader().loadTestsFromTestCase(Rx)) 132 suite_array.append(TestLoader().loadTestsFromTestCase(State)) 133 suite_array.append(TestLoader().loadTestsFromTestCase(User_functions)) 134 135 # Group all tests together. 136 full_suite = TestSuite(suite_array) 137 138 # Run the test suite. 139 results = runner.run(full_suite) 140 141 # Return the status of the tests. 142 return results.wasSuccessful()
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Jul 3 13:38:51 2014 | http://epydoc.sourceforge.net |