temporary support for deprecated api arguments #4531

This commit is contained in:
Andrej730
2024-04-08 15:47:31 +05:00
parent bc8b4e1a69
commit b106d6a4d1
4 changed files with 121 additions and 4 deletions
@@ -29,7 +29,9 @@ class TestAssignContainer(test.bootstrap.IFC4):
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcBuilding")
subelement = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
subelement2 = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
ifcopenshell.api.run("spatial.assign_container", self.file, products=[subelement, subelement2], relating_structure=element)
ifcopenshell.api.run(
"spatial.assign_container", self.file, products=[subelement, subelement2], relating_structure=element
)
ifcopenshell.api.run("spatial.unassign_container", self.file, products=[subelement, subelement2])
assert not self.file.by_type("IfcRelContainedInSpatialStructure")
@@ -37,8 +39,9 @@ class TestAssignContainer(test.bootstrap.IFC4):
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcBuilding")
subelement = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
subelement2 = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
ifcopenshell.api.run("spatial.assign_container", self.file, products=[subelement], relating_structure=element)
ifcopenshell.api.run("spatial.assign_container", self.file, products=[subelement2], relating_structure=element)
ifcopenshell.api.run(
"spatial.assign_container", self.file, products=[subelement, subelement2], relating_structure=element
)
ifcopenshell.api.run("spatial.unassign_container", self.file, products=[subelement])
rel = self.file.by_type("IfcRelContainedInSpatialStructure")[0]
assert list(rel.RelatedElements) == [subelement2]