pyworkflow.tests.tests module
- class pyworkflow.tests.tests.BaseTest(methodName='runTest')[source]
Bases:
TestCase
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- assertIsNotEmpty(setObject, msg=None)[source]
Check if the pyworkflow object is not None nor is empty
- assertSetSize(setObject, size=None, msg=None, diffDelta=None)[source]
Check if a pyworkflow Set is not None nor is empty, or of a determined size or of a determined size with a percentage (base 1) of difference
- compareSetProperties(set1: Set, set2: Set, ignore=['_size', '_mapperPath'])[source]
Compares 2 sets’ properties
- classmethod compareSets(test, set1, set2)[source]
Iterate the elements of both sets and check that all elements have equal attributes.
- classmethod getOutputPath(*filenames)[source]
Return the path to the SCIPION_HOME/tests/output dir joined with filename
- classmethod launchProtocol(prot, **kwargs)[source]
Launch a given protocol using cls.proj.
- Parameters
wait – if True the function will return after the protocol runs. If not specified, then if waitForOutput is passed, wait is false.
waitForOutputs – a list of expected outputs, ignored if wait=True
- classmethod newProtocol(protocolClass: T, **kwargs) T [source]
Create new protocols instances through the project and return a newly created protocol of the given class
- class pyworkflow.tests.tests.DataSet(name, folder, files, url=None)[source]
Bases:
object
Params:
#filesDict is dict with key, value pairs for each file
- class pyworkflow.tests.tests.GTestResult[source]
Bases:
TestResult
Subclass TestResult to output tests results with colors (green for success and red for failure) and write a report on an .xml file.
- addError(test, err)[source]
Called when an error has occurred. ‘err’ is a tuple of values as returned by sys.exc_info().
- addFailure(test, err)[source]
Called when an error has occurred. ‘err’ is a tuple of values as returned by sys.exc_info().
- numberTests = 0
- testFailed = 0
- xml = None