From c42bd75f2bbcdb5bfdfa84968cda56b0694e69b6 Mon Sep 17 00:00:00 2001 From: Jacob Wahlman <jacwa448@student.liu.se> Date: Mon, 20 Apr 2020 10:28:08 +0200 Subject: [PATCH] Fixed some issues w/ the test --- test/test_signal_flow_graph.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/test/test_signal_flow_graph.py b/test/test_signal_flow_graph.py index d1941752..a2114f81 100644 --- a/test/test_signal_flow_graph.py +++ b/test/test_signal_flow_graph.py @@ -170,25 +170,19 @@ class TestReplaceComponents: def test_replace_addition_large_tree(self, large_operation_tree): sfg = SFG(outputs=[Output(large_operation_tree)]) - component_id = "add2" + component_id = "add3" sfg = sfg.replace_component(Multiplication(name="Multi"), _id=component_id) assert "Multi" in sfg._components_by_name.keys() + assert component_id not in sfg._components_by_id.keys() def test_replace_no_input_component(self, operation_tree): sfg = SFG(outputs=[Output(operation_tree)]) component_id = "c1" - _value = sfg.find_by_id(component_id).value + _const = sfg.find_by_id(component_id) - sfg = sfg.replace_component(Constant(10), _id=component_id) - assert _value != sfg.find_by_id(component_id).value - - def test_replace_no_destination_component(self, operation_tree): - sfg = SFG(outputs=[Output(operation_tree)]) - component_id = "add1" - - sfg = sfg.replace_component(Multiplication(name="Multi"), _id=component_id) - assert "Multi" in sfg._components_by_name.keys() + sfg = sfg.replace_component(Constant(1), _id=component_id) + assert _const is not sfg.find_by_id(component_id) def test_no_match_on_replace(self, large_operation_tree): sfg = SFG(outputs=[Output(large_operation_tree)]) -- GitLab