more tests for ifc2x3

This commit is contained in:
Andrej730
2024-05-09 14:59:23 +05:00
parent 2d35869c41
commit 8ffb77551f
35 changed files with 181 additions and 31 deletions
@@ -32,3 +32,7 @@ class TestAddClassification(test.bootstrap.IFC4):
ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcProject")
ifcopenshell.api.run("classification.add_classification", self.file, classification=classification)
assert self.file.by_type("IfcClassification")[0].Name == "Name"
class TestAddClassificationIFC2X3(test.bootstrap.IFC2X3, TestAddClassification):
pass
@@ -47,7 +47,7 @@ class TestRemoveClassification(test.bootstrap.IFC4):
def test_removing_a_classification_and_all_of_its_references_when_associated_with_a_resource(self):
ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcProject")
result = ifcopenshell.api.run("classification.add_classification", self.file, classification="Name")
element = self.file.createIfcMaterial(Name="Material")
element = self.file.create_entity("IfcWall", Name="Wall")
ifcopenshell.api.run(
"classification.add_reference",
self.file,
@@ -59,4 +59,9 @@ class TestRemoveClassification(test.bootstrap.IFC4):
ifcopenshell.api.run("classification.remove_classification", self.file, classification=result)
assert not self.file.by_type("IfcClassification")
assert not self.file.by_type("IfcClassificationReference")
assert not self.file.by_type("IfcExternalReferenceRelationship")
if self.file.schema != "IFC2X3":
assert not self.file.by_type("IfcExternalReferenceRelationship")
class TestRemoveClassificationIFC2X3(test.bootstrap.IFC2X3, TestRemoveClassification):
pass