unify tests for ifc4 and ifc2x3

This commit is contained in:
Andrej730
2024-04-10 16:26:48 +05:00
parent c2840d92c2
commit 90bb2f0e16
6 changed files with 52 additions and 134 deletions
@@ -57,14 +57,6 @@ class TestGetElementSystems(test.bootstrap.IFC4):
class TestGetPorts(test.bootstrap.IFC4):
def test_run(self):
port = self.file.createIfcDistributionPort()
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcChiller")
ifcopenshell.api.run("system.assign_port", self.file, element=element, port=port)
assert subject.get_ports(element) == [port]
class TestGetPortsIFC2X3(test.bootstrap.IFC2X3):
def test_run(self):
port = self.file.createIfcDistributionPort()
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcFlowSegment")
@@ -72,6 +64,10 @@ class TestGetPortsIFC2X3(test.bootstrap.IFC2X3):
assert subject.get_ports(element) == [port]
class TestGetPortsIFC2X3(test.bootstrap.IFC2X3, TestGetPorts):
pass
class TestGetConnectedPort(test.bootstrap.IFC4):
def test_run(self):
port1 = ifcopenshell.api.run("system.add_port", self.file)
@@ -104,6 +100,5 @@ class TestGetConnectedToFrom(test.bootstrap.IFC4):
assert subject.get_connected_from(element2) == []
class TestGetConnectedToFromIFC2X3(test.bootstrap.IFC2X3):
def test_run(self):
TestGetConnectedToFrom.test_run(self)
class TestGetConnectedToFromIFC2X3(test.bootstrap.IFC2X3, TestGetConnectedToFrom):
pass