qsiprep.utils.testing module

Class and utilities for testing the workflows module

class qsiprep.utils.testing.TestWorkflow(methodName='runTest')[source]

Bases: TestCase

Subclass for test within the workflow module. invoke tests with ``python -m unittest discover test

assertIsAlmostExpectedWorkflow(expected_name, expected_interfaces, expected_inputs, expected_outputs, actual)[source]

somewhat hacky way to confirm workflows are as expected, but with low confidence

assertIsSubsetOfList(expecteds, actuals)[source]
assert_circular(workflow, circular_connections)[source]

check key paths in workflow by specifying some connections that should induce circular paths, which trips a NetworkX error. circular_connections is a list of tuples:

[(‘from_node_name’, ‘to_node_name’, (‘from_node.output_field’,’to_node.input_field’))]

assert_inputs_set(workflow, additional_inputs={})[source]

Check that all mandatory inputs of nodes in the workflow (at the first level) are already set. Additionally, check that inputs in additional_inputs are set. An input is “set” if it is

a) defined explicitly (e.g. in the Interface declaration) OR b) connected to another node’s output (e.g. using the workflow.connect method)

additional_inputs is a dict:

{‘node_name’: [‘mandatory’, ‘input’, ‘fields’]}

get_inputs_outputs(nodes)[source]
qsiprep.utils.testing.get_grouping_test_data()[source]

Write a number of grouping test datasets to base_path.