Source code for ewokscore.tests.test_graph

import pytest

from ewokscore.graph import load_graph
from ewokscore.graph.analysis import link_is_required






[docs] def test_wrong_argument_definitions(): nodes = [ {"id": "source1", "task_type": "method", "task_identifier": "dummy"}, {"id": "source2", "task_type": "method", "task_identifier": "dummy"}, {"id": "target", "task_type": "method", "task_identifier": "dummy"}, ] links = [ { "source": "source1", "target": "target", "data_mapping": [{"source_output": "a", "target_input": "a"}], }, { "source": "source2", "target": "target", "data_mapping": [{"source_output": "a", "target_input": "a"}], }, ] graph = {"graph": {"id": "test"}, "nodes": nodes, "links": links} with pytest.raises(ValueError): load_graph(graph) links[0]["conditions"] = [{"source_output": "a", "value": 1}] load_graph(graph) links[0]["required"] = True with pytest.raises(ValueError): load_graph(graph)