"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test_suite/gui_tests/__init__.py" between
relax-4.1.3.src.tar.bz2 and relax-5.0.0.src.tar.bz2

About: relax allows the study of molecular dynamics through the analysis of experimental NMR data. Organic molecules, proteins, RNA, DNA, sugars, and other biomolecules are all supported.

__init__.py  (relax-4.1.3.src.tar.bz2):__init__.py  (relax-5.0.0.src.tar.bz2)
############################################################################### ###############################################################################
# # # #
# Copyright (C) 2006,2008-2012 Edward d'Auvergne # # Copyright (C) 2006,2008-2012,2019 Edward d'Auvergne #
# # # #
# This file is part of the program relax (http://www.nmr-relax.com). # # This file is part of the program relax (http://www.nmr-relax.com). #
# # # #
# This program is free software: you can redistribute it and/or modify # # This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by # # it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or # # the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. # # (at your option) any later version. #
# # # #
# This program is distributed in the hope that it will be useful, # # This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of # # but WITHOUT ANY WARRANTY; without even the implied warranty of #
skipping to change at line 34 skipping to change at line 34
# Python module imports. # Python module imports.
from re import search from re import search
from unittest import TestSuite from unittest import TestSuite
import wx import wx
# relax module imports. # relax module imports.
from lib.errors import RelaxError from lib.errors import RelaxError
# relax GUI test module imports. # relax GUI test module imports.
from test_suite.formatting import format_test_name
from test_suite.gui_tests.bmrb import Bmrb from test_suite.gui_tests.bmrb import Bmrb
from test_suite.gui_tests.bruker import Bruker from test_suite.gui_tests.bruker import Bruker
from test_suite.gui_tests.consistency_tests import Ct from test_suite.gui_tests.consistency_tests import Ct
from test_suite.gui_tests.dead_uf_pages import Dead_uf_pages from test_suite.gui_tests.dead_uf_pages import Dead_uf_pages
from test_suite.gui_tests.frame_order import Frame_order from test_suite.gui_tests.frame_order import Frame_order
from test_suite.gui_tests.general import General from test_suite.gui_tests.general import General
from test_suite.gui_tests.interatomic import Interatomic from test_suite.gui_tests.interatomic import Interatomic
from test_suite.gui_tests.jw_mapping import Jw_mapping from test_suite.gui_tests.jw_mapping import Jw_mapping
from test_suite.gui_tests.model_free import Mf from test_suite.gui_tests.model_free import Mf
from test_suite.gui_tests.n_state_model import N_state_model from test_suite.gui_tests.n_state_model import N_state_model
skipping to change at line 67 skipping to change at line 68
'model_free', 'model_free',
'n_state_model', 'n_state_model',
'noe', 'noe',
'pipes', 'pipes',
'rx', 'rx',
'state'] 'state']
class GUI_test_runner: class GUI_test_runner:
"""Class for executing all of the GUI tests.""" """Class for executing all of the GUI tests."""
def run(self, tests=None, runner=None): def run(self, tests=None, runner=None, list_tests=False):
"""Run the GUI tests. """Run the GUI tests.
The GUI test list should be something like ['N_state_model.test_stereoch em_analysis']. The first part is the imported test case class, the second is th e specific test. The GUI test list should be something like ['N_state_model.test_stereoch em_analysis']. The first part is the imported test case class, the second is th e specific test.
@keyword tests: The list of GUI tests to preform. @keyword tests: The list of GUI tests to preform.
@type tests: list of str @type tests: list of str
@keyword runner: A test runner such as TextTestRunner. For an exampl @keyword runner: A test runner such as TextTestRunner. For an ex
e of how to write a test runner see the python documentation for TextTestRunner ample of how to write a test runner see the python documentation for TextTestRun
in the python source. ner in the python source.
@type runner: Test runner instance (TextTestRunner, BaseGUITestRun @type runner: Test runner instance (TextTestRunner, BaseGUITes
ner subclass, etc.) tRunner subclass, etc.)
@keyword list_tests: A flag which if True will cause the tests to be
listed rather than executed.
@type list_tests: bool
""" """
# Create an array of test suites (add your new TestCase classes here). # Create an array of test suites (add your new TestCase classes here).
suite_array = [] suite_array = []
# Specific tests. # Specific tests.
for test in tests: for test in tests:
# The entire test class. # The entire test class.
if not search('\.', test): if not search('\.', test):
# Check that the class exists. # Check that the class exists.
skipping to change at line 135 skipping to change at line 138
suite_array.append(TestLoader().loadTestsFromTestCase(Noe)) suite_array.append(TestLoader().loadTestsFromTestCase(Noe))
suite_array.append(TestLoader().loadTestsFromTestCase(Pipes)) suite_array.append(TestLoader().loadTestsFromTestCase(Pipes))
suite_array.append(TestLoader().loadTestsFromTestCase(Relax_disp)) suite_array.append(TestLoader().loadTestsFromTestCase(Relax_disp))
suite_array.append(TestLoader().loadTestsFromTestCase(Rx)) suite_array.append(TestLoader().loadTestsFromTestCase(Rx))
suite_array.append(TestLoader().loadTestsFromTestCase(State)) suite_array.append(TestLoader().loadTestsFromTestCase(State))
suite_array.append(TestLoader().loadTestsFromTestCase(User_functions )) suite_array.append(TestLoader().loadTestsFromTestCase(User_functions ))
# Group all tests together. # Group all tests together.
full_suite = TestSuite(suite_array) full_suite = TestSuite(suite_array)
# Only list the tests.
if list_tests:
for suite in full_suite._tests:
for test in suite:
print(format_test_name(test.id()))
return True
# Run the test suite. # Run the test suite.
results = runner.run(full_suite) results = runner.run(full_suite)
# Return the status of the tests. # Return the status of the tests.
return results.wasSuccessful() return results.wasSuccessful()
 End of changes. 5 change blocks. 
9 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)