From a0e4bdcbef81ab92aed4c834800693b7d4ea68ad Mon Sep 17 00:00:00 2001 From: Andrej Date: Wed, 4 Jun 2025 12:28:50 +0500 Subject: [PATCH] ifcpatch - fix ifc2x3 bootstrap (c58b84d) After c58b84d append_asset requires user to be a valid IFC entity. --- src/ifcpatch/test/bootstrap.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ifcpatch/test/bootstrap.py b/src/ifcpatch/test/bootstrap.py index 1603fcdb26..963a8d0d7a 100644 --- a/src/ifcpatch/test/bootstrap.py +++ b/src/ifcpatch/test/bootstrap.py @@ -46,7 +46,14 @@ class IFC2X3: @pytest.fixture(autouse=True) def setup(self): self.file: ifcopenshell.file = ifcopenshell.api.run("project.create_file", version="IFC2X3") - ifcopenshell.api.owner.settings.get_user = lambda ifc: ifc.createIfcPersonAndOrganization() + + def get_user(ifc_file: ifcopenshell.file) -> ifcopenshell.entity_instance: + person = ifcopenshell.api.owner.add_person(ifc_file) + organization = ifcopenshell.api.owner.add_organisation(ifc_file) + pao = ifcopenshell.api.owner.add_person_and_organisation(ifc_file, person, organization) + return pao + + ifcopenshell.api.owner.settings.get_user = get_user ifcopenshell.api.owner.settings.get_application = lambda ifc: ifc.createIfcApplication() ifcopenshell.api.pre_listeners = {} ifcopenshell.api.post_listeners = {}