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

Function test_unused_node

tests/engine/runner/test_dask.py:170–198  ·  view source on GitHub ↗
(default_model_storage: ModelStorage)

Source from the content-addressed store, hash-verified

168
169
170def test_unused_node(default_model_storage: ModelStorage):
171 graph_schema = GraphSchema(
172 {
173 "provide": SchemaNode(
174 needs={},
175 uses=ProvideX,
176 fn="provide",
177 constructor_name="create",
178 config={},
179 is_target=True,
180 ),
181 # This node will not fail as it will be pruned because it is not a target
182 # or a target's ancestor.
183 "assert_false": SchemaNode(
184 needs={"i": "input"},
185 uses=AssertComponent,
186 fn="run_assert",
187 constructor_name="create",
188 config={"value_to_assert": "some_value"},
189 ),
190 }
191 )
192 runner = DaskGraphRunner(
193 graph_schema=graph_schema,
194 model_storage=default_model_storage,
195 execution_context=ExecutionContext(graph_schema=graph_schema, model_id="1"),
196 )
197 results = runner.run(inputs={"input": "some_other_value"})
198 assert results == {"provide": 1}
199
200
201def test_non_eager_can_use_inputs_for_constructor(default_model_storage: ModelStorage):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…