MCPcopy
hub / github.com/RasaHQ/rasa / test_multi_node_graph_run

Function test_multi_node_graph_run

tests/engine/runner/test_dask.py:21–52  ·  view source on GitHub ↗
(eager: bool, default_model_storage: ModelStorage)

Source from the content-addressed store, hash-verified

19
20@pytest.mark.parametrize("eager", [True, False])
21def test_multi_node_graph_run(eager: bool, default_model_storage: ModelStorage):
22 graph_schema = GraphSchema(
23 {
24 "add": SchemaNode(
25 needs={"i1": "first_input", "i2": "second_input"},
26 uses=AddInputs,
27 fn="add",
28 constructor_name="create",
29 config={},
30 eager=eager,
31 ),
32 "subtract_2": SchemaNode(
33 needs={"i": "add"},
34 uses=SubtractByX,
35 fn="subtract_x",
36 constructor_name="create",
37 config={"x": 2},
38 eager=eager,
39 is_target=True,
40 ),
41 }
42 )
43
44 execution_context = ExecutionContext(graph_schema=graph_schema, model_id="1")
45
46 runner = DaskGraphRunner(
47 graph_schema=graph_schema,
48 model_storage=default_model_storage,
49 execution_context=execution_context,
50 )
51 results = runner.run(inputs={"first_input": 3, "second_input": 4})
52 assert results["subtract_2"] == 5
53
54
55@pytest.mark.parametrize("eager", [True, False])

Callers

nothing calls this directly

Calls 5

runMethod · 0.95
GraphSchemaClass · 0.90
SchemaNodeClass · 0.90
ExecutionContextClass · 0.90
DaskGraphRunnerClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…