Replace all ifcopenshell.api.run with ifcopenshell.api static functions.

This commit is contained in:
Dion Moult
2024-06-28 12:36:31 +10:00
parent b5d613989e
commit 07060fc769
432 changed files with 4633 additions and 4856 deletions
@@ -18,7 +18,8 @@
import pytest
import test.bootstrap
import ifcopenshell.api
import ifcopenshell.api.root
import ifcopenshell.api.type
import ifcopenshell.util.brick as subject
@@ -34,7 +35,7 @@ class TestGetBrickTypeIFC4(test.bootstrap.IFC4):
class TestGetBrickTypeIFC2X3(test.bootstrap.IFC2X3):
def test_run(self):
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcFlowController")
type_element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcAirTerminalBoxType")
ifcopenshell.api.run("type.assign_type", self.file, related_objects=[element], relating_type=type_element)
element = ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcFlowController")
type_element = ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcAirTerminalBoxType")
ifcopenshell.api.type.assign_type(self.file, related_objects=[element], relating_type=type_element)
assert subject.get_brick_type(element) == "https://brickschema.org/schema/Brick#TerminalUnit"