def test_get_runner_returns_flow_or_flow_runner(): s = Memory() f = Flow("test") s.add_flow(f) runner = s.get_runner("test") assert runner is f with set_temporary_config({"engine.flow_runner.default_class": FlowRunner}): runner = s.get_runner("test", return_flow=False) assert isinstance(runner, FlowRunner) assert runner.flow is f
def test_multiple_flows_in_storage(): s = Memory() f = Flow("test") g = Flow("other") z = Flow("not") s.add_flow(f) s.add_flow(g) assert "test" in s assert "other" in s assert "not" not in s assert s.get_runner("test") is f assert s.get_runner("other") is g assert s.flows["test"] is f assert s.flows["other"] is g
def test_get_runner_raises_if_flow_not_present(): s = Memory() with pytest.raises(ValueError): s.get_runner("test")