cis_interface.tests package¶
Submodules¶
cis_interface.tests.test_backwards module¶
-
cis_interface.tests.test_backwards.
test_assert_bytes
()[source]¶ Ensure that the proper byte types are identified.
-
cis_interface.tests.test_backwards.
test_assert_str
()[source]¶ Ensure that the proper str types are identified.
cis_interface.tests.test_config module¶
-
cis_interface.tests.test_config.
make_temp
(fname_base, count=1)[source]¶ Create temporary copies of same file with different extensions.
cis_interface.tests.test_platform module¶
Tests for platform compatiblity.
cis_interface.tests.test_runner module¶
-
class
cis_interface.tests.test_runner.
TestCisRunner
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.CisTestBase
Tests of the CisRunner class.
-
setup
(*args, **kwargs)[source]¶ Record the number of open comms, threads, and file descriptors.
Parameters: - nprev_comm (int, optional) – Number of previous comm channels. If not provided, it is determined to be the present number of default comms.
- nprev_thread (int, optional) – Number of previous threads. If not provided, it is determined to be the present number of threads.
- nprev_fd (int, optional) – Number of previous open file descriptors. If not provided, it is determined to be the present number of open file descriptors.
-
cis_interface.tests.test_scanf module¶
cis_interface.tests.test_schema module¶
-
cis_interface.tests.test_schema.
test_cdriver2commtype_error
()[source]¶ Test error when invalid driver supplied.
cis_interface.tests.test_tests module¶
-
class
cis_interface.tests.test_tests.
TestCisTest
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.CisTestClass
Test errors for uninitialized CisTestClass.
cis_interface.tests.test_timing module¶
-
class
cis_interface.tests.test_timing.
TestTimedRun
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_timing.TimedRunTestBase
Test class for the TimedRun class using existing data.
-
comm_type
= 'ZMQComm'¶
-
language
= 'python'¶
-
platform
= 'Linux'¶
-
python_ver
= '2.7'¶
-
-
class
cis_interface.tests.test_timing.
TestTimedRunTemp
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_timing.TimedRunTestBase
Test class for the TimedRun class using temporary data.
-
description_prefix
¶ String prefix to prepend docstr test message with.
-
-
class
cis_interface.tests.test_timing.
TestTimedRunTempNoPerf
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_timing.TestTimedRunTemp
Test class for the TimedRun class using temporary data without perf.
-
description_prefix
¶ String prefix to prepend docstr test message with.
-
dont_use_perf
= True¶
-
-
class
cis_interface.tests.test_timing.
TimedRunTestBase
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.CisTestClass
Base test class for the TimedRun class.
-
comm_type
= None¶
-
count
= 1¶
-
dont_use_perf
= False¶
-
language
= 'c'¶
-
max_errors
= 5¶
-
nrep
= 1¶
-
platform
= None¶
-
python_ver
= None¶
-
size
= 1¶
-
test_name
= 'timed_pipe'¶
-
cis_interface.tests.test_tools module¶
-
class
cis_interface.tests.test_tools.
TestCisClass
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.CisTestClass
Test basic behavior of CisTestClass.
cis_interface.tests.test_units module¶
-
class
cis_interface.tests.test_units.
TestUnits
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.CisTestBase
Tests for using pint for units.
cis_interface.tests.test_yamlfile module¶
-
class
cis_interface.tests.test_yamlfile.
TestYamlComponentError
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error for non-dictionary component.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnection
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection between I/O channels.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionError
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error when there is not connection for a model I/O channel.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionError_forkin
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error when there is not connection for a fork input channel.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionError_readmeth
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error when read_meth is specified for non-file.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionError_writemeth
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error when write_meth is specified for non-file.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionFork
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection between I/O channels.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionInputAsciiFile
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection with AsciiFile.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionInputAsciiMap
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection with AsciiMap.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionInputAsciiTable
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection with AsciiTable.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionInputAsciiTableArray
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection with AsciiTable as array.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionInputFile
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection with File.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionInputFileReadMethError
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error for invalid read_meth.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionInputFileWriteMethError
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error for invalid write_meth.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionInputFile_wait
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection with File where wait_for_creation specified.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionInputObj
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection with Obj file.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionInputPandas
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection with Pandas csv.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionInputPickle
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection with Pickle.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionInputPly
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection with Ply file.
-
class
cis_interface.tests.test_yamlfile.
TestYamlConnectionTranslator
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test connection between I/O channels.
-
class
cis_interface.tests.test_yamlfile.
TestYamlDuplicateError
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error when there are two components with the same name.
-
class
cis_interface.tests.test_yamlfile.
TestYamlIODatatype
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test specification of datatype via schema.
-
class
cis_interface.tests.test_yamlfile.
TestYamlIODrivers
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test full specification of IO drivers.
-
class
cis_interface.tests.test_yamlfile.
TestYamlMissingConnArgsError
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error when there is a missing arguments to a connection.
-
class
cis_interface.tests.test_yamlfile.
TestYamlMissingConnIOError
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error when there is no model input/output matching connection.
-
class
cis_interface.tests.test_yamlfile.
TestYamlMissingConnInputError
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error when there is no model output matching connection input.
-
class
cis_interface.tests.test_yamlfile.
TestYamlMissingConnInputFileError
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error when there is no file for missing connection input.
-
class
cis_interface.tests.test_yamlfile.
TestYamlMissingIOArgsError_input
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error when there is a missing arguments to an input driver.
-
class
cis_interface.tests.test_yamlfile.
TestYamlMissingIOArgsError_output
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error when there is a missing arguments to an output driver.
-
class
cis_interface.tests.test_yamlfile.
TestYamlMissingModelArgsError
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBaseError
Test error when there is a missing arguments to a model.
-
class
cis_interface.tests.test_yamlfile.
TestYamlModelOnly
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test parsing of different numbers/styles of models.
-
class
cis_interface.tests.test_yamlfile.
TestYamlServerClient
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test specification of server/client models.
-
class
cis_interface.tests.test_yamlfile.
YamlTestBase
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.CisTestClass
Test base for yamlfile.
-
class
cis_interface.tests.test_yamlfile.
YamlTestBaseError
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.test_yamlfile.YamlTestBase
Test error for yamlfile.
-
cis_interface.tests.test_yamlfile.
direct_translate
(msg)[source]¶ Test translator that just returns passed message.
Module contents¶
Testing things.
-
cis_interface.tests.
ErrorClass
(base_class, *args, **kwargs)[source]¶ Wrapper to return errored version of a class.
Parameters: - base_class (class) – Base class to use.
- *args – Additional arguments are passed to the class constructor.
- **kwargs – Additional keyword arguments are passed to the class constructor.
-
class
cis_interface.tests.
CisTestBase
(*args, **kwargs)[source]¶ Bases:
unittest.case.TestCase
Wrapper for unittest.TestCase that allows use of setup and teardown methods along with description prefix.
Parameters: -
attr_list
= []
-
check_file
(fname, result)[source]¶ Check that a file exists, is the correct size, and has the correct contents.
Parameters:
-
check_file_contents
(fname, result)[source]¶ Check that the contents of a file are correct.
Parameters:
-
check_file_exists
(fname)[source]¶ Check that a file exists.
Parameters: fname (str) – Full path to the file that should be checked.
-
description_prefix
¶ String prefix to prepend docstr test message with.
-
setup
(nprev_comm=None, nprev_thread=None, nprev_fd=None)[source]¶ Record the number of open comms, threads, and file descriptors.
Parameters: - nprev_comm (int, optional) – Number of previous comm channels. If not provided, it is determined to be the present number of default comms.
- nprev_thread (int, optional) – Number of previous threads. If not provided, it is determined to be the present number of threads.
- nprev_fd (int, optional) – Number of previous open file descriptors. If not provided, it is determined to be the present number of open file descriptors.
-
tearDown
(*args, **kwargs)[source]¶ Hook method for deconstructing the test fixture after testing it.
-
teardown
(ncurr_comm=None, ncurr_thread=None, ncurr_fd=None)[source]¶ Check the number of open comms, threads, and file descriptors.
Parameters: - ncurr_comm (int, optional) – Number of current comms. If not provided, it is determined to be the present number of comms.
- ncurr_thread (int, optional) – Number of current threads. If not provided, it is determined to be the present number of threads.
- ncurr_fd (int, optional) – Number of current open file descriptors. If not provided, it is determined to be the present number of open file descriptors.
-
-
class
cis_interface.tests.
CisTestClass
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.CisTestBase
Test class for a CisClass.
-
description_prefix
¶ String prefix to prepend docstr test message with.
-
import_cls
¶ Import the tested class from its module
-
testing_option_kws
= {}¶
-
-
class
cis_interface.tests.
CisTestClassInfo
(*args, **kwargs)[source]¶ Bases:
cis_interface.tests.CisTestClass
,cis_interface.tests.IOInfo
Test class for a CisClass with IOInfo available.