From 27dc81544cbb5dbe5ec7f399ac07969430285aeb Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 7 Oct 2022 13:34:19 +1100 Subject: [PATCH] Minor fixes to IfcTester testcases --- src/ifctester/test/ids_doc_generator.py | 2 +- src/ifctester/test/test_facet.py | 10 +++++----- src/ifctester/test/test_ids.py | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/ifctester/test/ids_doc_generator.py b/src/ifctester/test/ids_doc_generator.py index 575b43cbde..cd43e298f5 100644 --- a/src/ifctester/test/ids_doc_generator.py +++ b/src/ifctester/test/ids_doc_generator.py @@ -79,7 +79,7 @@ class FacetDocGenerator: # the entity type passed to us in `inst`. specs = ids.Ids(title=name) spec = ids.Specification(name=name) - spec.applicability.append(ids.Entity(name=inst.is_a())) + spec.applicability.append(ids.Entity(name=inst.is_a().upper())) spec.requirements.append(facet) specs.specifications.append(spec) diff --git a/src/ifctester/test/test_facet.py b/src/ifctester/test/test_facet.py index 555d772b12..a1afc8074f 100644 --- a/src/ifctester/test/test_facet.py +++ b/src/ifctester/test/test_facet.py @@ -699,15 +699,15 @@ class TestClassification: project = ifc.createIfcProject() system_a = ifcopenshell.api.run("classification.add_classification", ifc, classification=system_a) element0 = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcWall") - element1 = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcWall") + element1 = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcSlab") ifcopenshell.api.run( "classification.add_reference", ifc, product=element1, reference=ref1, classification=system_a ) - element11 = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcWall") + element11 = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcColumn") ifcopenshell.api.run( "classification.add_reference", ifc, product=element11, reference=ref11, classification=system_a ) - element22 = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcWall") + element22 = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcBeam") ifcopenshell.api.run( "classification.add_reference", ifc, @@ -738,9 +738,9 @@ class TestClassification: run("A required facet checks all parameters as normal", facet=facet, inst=element1, expected=True) facet = Classification(minOccurs=0, maxOccurs=0) run("A prohibited facet returns the opposite of a required facet", facet=facet, inst=element1, expected=False) - facet = Attribute(name="Name", minOccurs=0) + facet = Classification(minOccurs=0) run("An optional facet always passes regardless of outcome 1/2", facet=facet, inst=element0, expected=True) - facet = Attribute(name="Rabbit", minOccurs=0) + facet = Classification(minOccurs=0) run("An optional facet always passes regardless of outcome 2/2", facet=facet, inst=element1, expected=True) facet = Classification(value="1") diff --git a/src/ifctester/test/test_ids.py b/src/ifctester/test/test_ids.py index 310090315f..bfb77e3288 100644 --- a/src/ifctester/test/test_ids.py +++ b/src/ifctester/test/test_ids.py @@ -118,7 +118,7 @@ class TestIds: wall.Name = "Waldo" run("A minimal IDS can check a minimal IFC 2/2", specs, model, True, [wall, waldo], []) - spec.ifcVersion = [] + spec.ifcVersion = ["IFC2X3"] run( "Specification version is purely metadata and does not impact pass or fail result", specs, @@ -127,6 +127,7 @@ class TestIds: [wall, waldo], ) + spec.ifcVersion = [] spec.minOccurs = 1 model = ifcopenshell.file() waldo = model.createIfcWall(Name="Waldo")