pyworkflow.tests.tests module¶
- class pyworkflow.tests.tests.BaseTest(methodName='runTest')[source]¶
Bases:
unittest.case.TestCase
- 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
- 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. Accepted **kwargs:
- 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, **kwargs)[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
- class pyworkflow.tests.tests.GTestResult[source]¶
Bases:
unittest.result.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¶