TestRig#
- class maize.utilities.testing.TestRig(cls: type[Node], config: Config | None = None)[source]#
Bases:
object
Test rig for user Node tasks. Can be loaded with parameters and inputs.
- Parameters:
cls – Node child class to be wrapped
config – Global configuration for the parent workflow
- node#
Node instance
- Type:
See also
MockChannel
Class simulating the behaviour of normal channels without the issues associated with multiple processes
Examples
>>> rig = TestRig(Foo) ... rig.set_inputs(inputs=dict(inp="bar")) ... rig.set_parameters(parameters=dict(param=42)) ... rig.setup(n_outputs=2) ... outputs = rig.run()
Methods
__init__
(cls[, config])run
()Run the node with inputs and parameters previously set.
set_inputs
(inputs)Set the task input values
set_parameters
(parameters)Set the task parameter values
setup
([n_outputs])Instantiate the node and create mock interfaces.
setup_run
([inputs, parameters, n_outputs])Instantiate and run the node with a specific set of parameters and inputs.
Attributes