"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test_suite/system_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-2010,2012 Edward d'Auvergne # # Copyright (C) 2006,2008-2010,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 33 skipping to change at line 33
"""The relax system/functional tests.""" """The relax system/functional tests."""
# Python module imports. # Python module imports.
from re import search from re import search
from unittest import TestSuite from unittest import TestSuite
# relax module imports. # relax module imports.
from lib.errors import RelaxError from lib.errors import RelaxError
# relax system/functional test module imports. # relax system/functional test module imports.
from test_suite.formatting import format_test_name
from test_suite.relax_test_loader import RelaxTestLoader as TestLoader from test_suite.relax_test_loader import RelaxTestLoader as TestLoader
from test_suite.system_tests.align_tensor import Align_tensor from test_suite.system_tests.align_tensor import Align_tensor
from test_suite.system_tests.angles import Angles from test_suite.system_tests.angles import Angles
from test_suite.system_tests.bmrb import Bmrb from test_suite.system_tests.bmrb import Bmrb
from test_suite.system_tests.bruker import Bruker from test_suite.system_tests.bruker import Bruker
from test_suite.system_tests.chemical_shift import Chemical_shift from test_suite.system_tests.chemical_shift import Chemical_shift
from test_suite.system_tests.consistency_tests import Ct from test_suite.system_tests.consistency_tests import Ct
from test_suite.system_tests.dasha import Dasha from test_suite.system_tests.dasha import Dasha
from test_suite.system_tests.diffusion_tensor import Diffusion_tensor from test_suite.system_tests.diffusion_tensor import Diffusion_tensor
from test_suite.system_tests.frame_order import Frame_order from test_suite.system_tests.frame_order import Frame_order
skipping to change at line 113 skipping to change at line 114
'sequence', 'sequence',
'spectrum', 'spectrum',
'state', 'state',
'structure', 'structure',
'unit_vectors', 'unit_vectors',
'value'] 'value']
class System_test_runner: class System_test_runner:
"""Class for executing all of the system/functional tests.""" """Class for executing all of the system/functional tests."""
def run(self, tests=None, runner=None): def run(self, tests=None, runner=None, list_tests=False):
"""Run the system/functional tests. """Run the system/functional tests.
The system test list should be something like ['N_state_model.test_stere ochem_analysis']. The first part is the imported test case class, the second is the specific test. The system test list should be something like ['N_state_model.test_stere ochem_analysis']. The first part is the imported test case class, the second is the specific test.
@keyword tests: The list of system tests to preform. @keyword tests: The list of system 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 202 skipping to change at line 205
suite_array.append(TestLoader().loadTestsFromTestCase(Sequence)) suite_array.append(TestLoader().loadTestsFromTestCase(Sequence))
suite_array.append(TestLoader().loadTestsFromTestCase(Spectrum)) suite_array.append(TestLoader().loadTestsFromTestCase(Spectrum))
suite_array.append(TestLoader().loadTestsFromTestCase(State)) suite_array.append(TestLoader().loadTestsFromTestCase(State))
suite_array.append(TestLoader().loadTestsFromTestCase(Structure)) suite_array.append(TestLoader().loadTestsFromTestCase(Structure))
suite_array.append(TestLoader().loadTestsFromTestCase(Unit_vectors)) suite_array.append(TestLoader().loadTestsFromTestCase(Unit_vectors))
suite_array.append(TestLoader().loadTestsFromTestCase(Value)) suite_array.append(TestLoader().loadTestsFromTestCase(Value))
# 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)