From b708100c03e38943b5af0e3c00bb4eb3fcfc1f3e Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 24 Aug 2023 22:12:30 +1000 Subject: [PATCH] See #3581. Fix failing IOS tests. --- .../ifcopenshell/api/document/remove_information.py | 2 -- .../test/api/document/test_remove_information.py | 1 - .../test/api/resource/test_calculate_resource_work.py | 1 + src/ifcopenshell-python/test/util/test_pset.py | 3 ++- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/document/remove_information.py b/src/ifcopenshell-python/ifcopenshell/api/document/remove_information.py index 64fba5975c..7869a1c317 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/document/remove_information.py +++ b/src/ifcopenshell-python/ifcopenshell/api/document/remove_information.py @@ -50,9 +50,7 @@ class Usecase: for rel in self.settings["information"].IsPointer or []: for information in rel.RelatedDocuments: ifcopenshell.api.run("document.remove_information", self.file, information=information) - self.file.remove(rel) - # remove IfcDocumentInformationRelationship so it won't become invalid for rel in self.settings["information"].IsPointedTo or []: if rel.RelatedDocuments == (self.settings["information"],): self.file.remove(rel) diff --git a/src/ifcopenshell-python/test/api/document/test_remove_information.py b/src/ifcopenshell-python/test/api/document/test_remove_information.py index d03a7341ad..ec2adaf9fb 100644 --- a/src/ifcopenshell-python/test/api/document/test_remove_information.py +++ b/src/ifcopenshell-python/test/api/document/test_remove_information.py @@ -54,7 +54,6 @@ class TestRemoveInformation(test.bootstrap.IFC4): project = self.file.createIfcProject() information = ifcopenshell.api.run("document.add_information", self.file, parent=None) information2 = ifcopenshell.api.run("document.add_information", self.file, parent=information) - ifcopenshell.api.run("document.add_reference", self.file, information=information) ifcopenshell.api.run("document.add_reference", self.file, information=information2) ifcopenshell.api.run("document.remove_information", self.file, information=information) assert len(self.file.by_type("IfcDocumentInformation")) == 0 diff --git a/src/ifcopenshell-python/test/api/resource/test_calculate_resource_work.py b/src/ifcopenshell-python/test/api/resource/test_calculate_resource_work.py index 040a9ba53f..83a9d9303d 100644 --- a/src/ifcopenshell-python/test/api/resource/test_calculate_resource_work.py +++ b/src/ifcopenshell-python/test/api/resource/test_calculate_resource_work.py @@ -18,6 +18,7 @@ import test.bootstrap import ifcopenshell.api +import ifcopenshell.util.constraint class TestCalculateResourceWork(test.bootstrap.IFC4): diff --git a/src/ifcopenshell-python/test/util/test_pset.py b/src/ifcopenshell-python/test/util/test_pset.py index 9fefd61396..a953193b97 100644 --- a/src/ifcopenshell-python/test/util/test_pset.py +++ b/src/ifcopenshell-python/test/util/test_pset.py @@ -46,5 +46,6 @@ class TestPsetQto: names = self.pset_qto.get_applicable_names("IfcWall") assert "Pset_WallCommon" in names names = self.pset_qto.get_applicable_names("IfcWallType") - assert len(names) == 5 + assert len(names) == 6 assert "Pset_WallCommon" in names + assert "Qto_WallBaseQuantities" in names # Backported fix for IFC4