You can now remove ports

This commit is contained in:
Dion Moult
2022-05-06 10:35:12 +10:00
parent 4b6ebe7b1c
commit 92432f453d
5 changed files with 47 additions and 1 deletions
+30
View File
@@ -92,6 +92,15 @@ class TestSelectSystemProducts:
class TestShowPorts:
def test_run(self, ifc, system):
ifc.get_object("element").should_be_called().will_return("obj")
ifc.is_moved("obj").should_be_called().will_return(False)
system.get_ports("element").should_be_called().will_return(["port"])
system.load_ports("element", ["port"]).should_be_called()
system.select_elements(["port"]).should_be_called()
subject.show_ports(ifc, system, element="element")
def test_syncing_locations_if_objects_moved_prior_to_showing_ports(self, ifc, system):
ifc.get_object("element").should_be_called().will_return("obj")
ifc.is_moved("obj").should_be_called().will_return(True)
system.run_geometry_edit_object_placement(obj="obj").should_be_called()
@@ -104,6 +113,20 @@ class TestShowPorts:
class TestHidePorts:
def test_run(self, ifc, system):
ifc.get_object("element").should_be_called().will_return("obj")
ifc.is_moved("obj").should_be_called().will_return(False)
system.get_ports("element").should_be_called().will_return(["port"])
ifc.get_object("port").should_be_called().will_return("port_obj")
ifc.is_moved("port_obj").should_be_called().will_return(True)
system.run_geometry_edit_object_placement(obj="port_obj").should_be_called()
system.delete_element_objects(["port"]).should_be_called()
subject.hide_ports(ifc, system, element="element")
def test_syncing_locations_if_objects_moved_prior_to_hiding_ports(self, ifc, system):
ifc.get_object("element").should_be_called().will_return("obj")
ifc.is_moved("obj").should_be_called().will_return(True)
system.run_geometry_edit_object_placement(obj="obj").should_be_called()
@@ -128,6 +151,13 @@ class TestAddPort:
subject.add_port(ifc, system, element="element")
class TestRemovePort:
def test_run(self, ifc, system):
system.delete_element_objects(["port"]).should_be_called()
ifc.run("root.remove_product", product="port").should_be_called()
subject.remove_port(ifc, system, port="port")
class TestSetFlowDirection:
def test_run(self, ifc, system):
system.get_connected_port("port").should_be_called().will_return("port2")