From ede278db8fbd7b923ba511cdcdd7219214a640b2 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 9 Apr 2024 18:30:33 +0500 Subject: [PATCH] ifcopenshell.util.element.get_nest test --- src/ifcopenshell-python/test/util/test_element.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ifcopenshell-python/test/util/test_element.py b/src/ifcopenshell-python/test/util/test_element.py index 7b5c674da5..15da366d17 100644 --- a/src/ifcopenshell-python/test/util/test_element.py +++ b/src/ifcopenshell-python/test/util/test_element.py @@ -760,6 +760,14 @@ class TestGetAggregateIFC4(test.bootstrap.IFC4): assert subject.get_aggregate(subelement) == element +class TestGetNestIFC4(test.bootstrap.IFC4): + def test_getting_the_nest_parent_of_an_element(self): + element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcTask") + subelement = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcTask") + ifcopenshell.api.run("nest.assign_object", self.file, related_objects=[subelement], relating_object=element) + assert subject.get_nest(subelement) == element + + class TestReplaceAttributeIFC4(test.bootstrap.IFC4): def test_replacing_an_elements_attribute(self): element = self.file.createIfcWall("foo")