Skip to content
Snippets Groups Projects

Resolve "Replacing Operations in SFG"

Merged Jacob Wahlman requested to merge 15-replacing-operations-in-sfg into develop
All threads resolved!
1 file
+ 5
11
Compare changes
  • Side-by-side
  • Inline
@@ -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)])
Loading