mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Replace all ifcopenshell.api.run with ifcopenshell.api static functions.
This commit is contained in:
@@ -18,14 +18,14 @@
|
||||
|
||||
import pytest
|
||||
import ifcopenshell
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.api.project
|
||||
import ifcopenshell.api.owner.settings
|
||||
|
||||
|
||||
class IFC4X3:
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup(self):
|
||||
self.file: ifcopenshell.file = ifcopenshell.api.run("project.create_file", version="IFC4X3")
|
||||
self.file: ifcopenshell.file = ifcopenshell.api.project.create_file(version="IFC4X3")
|
||||
ifcopenshell.api.owner.settings.get_user = lambda ifc: (ifc.by_type("IfcPersonAndOrganization") or [None])[0]
|
||||
ifcopenshell.api.owner.settings.get_application = lambda ifc: (ifc.by_type("IfcApplication") or [None])[0]
|
||||
ifcopenshell.api.pre_listeners = {}
|
||||
@@ -35,7 +35,7 @@ class IFC4X3:
|
||||
class IFC4:
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup(self):
|
||||
self.file: ifcopenshell.file = ifcopenshell.api.run("project.create_file")
|
||||
self.file: ifcopenshell.file = ifcopenshell.api.project.create_file()
|
||||
ifcopenshell.api.owner.settings.get_user = lambda ifc: (ifc.by_type("IfcPersonAndOrganization") or [None])[0]
|
||||
ifcopenshell.api.owner.settings.get_application = lambda ifc: (ifc.by_type("IfcApplication") or [None])[0]
|
||||
ifcopenshell.api.pre_listeners = {}
|
||||
@@ -45,7 +45,7 @@ class IFC4:
|
||||
class IFC2X3:
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup(self):
|
||||
self.file: ifcopenshell.file = ifcopenshell.api.run("project.create_file", version="IFC2X3")
|
||||
self.file: ifcopenshell.file = ifcopenshell.api.project.create_file(version="IFC2X3")
|
||||
|
||||
def get_user(ifc: ifcopenshell.file) -> ifcopenshell.entity_instance:
|
||||
user = next(iter(ifc.by_type("IfcPersonAndOrganization")), None)
|
||||
|
||||
Reference in New Issue
Block a user