diff --git a/src/ifctester/ifctester/facet.py b/src/ifctester/ifctester/facet.py index 08d28e434c..a9498d5eb7 100644 --- a/src/ifctester/ifctester/facet.py +++ b/src/ifctester/ifctester/facet.py @@ -136,6 +136,7 @@ class Facet: elif requirement.cardinality == "prohibited": templates = self.prohibited_templates elif requirement.cardinality == "optional": + templates = self.requirement_templates templates = [ t.replace("shall", "may").replace("Shall", "May").replace("must", "may") for t in templates ] diff --git a/src/ifctester/test/test_ids.py b/src/ifctester/test/test_ids.py index bfee66926c..9985a14a2c 100644 --- a/src/ifctester/test/test_ids.py +++ b/src/ifctester/test/test_ids.py @@ -170,29 +170,34 @@ class TestIds: waldo = model.createIfcSlab(Name="Waldo") run("Optional specifications may still pass if nothing is applicable", specs, model, True) + specs = ids.Ids(title="Title") + spec = ids.Specification(name="Name") + spec.applicability.append(ids.Entity(name="IFCWALL")) + spec.applicability.append(ids.Attribute(name="Name", value="Waldo")) + specs.specifications.append(spec) spec.set_usage("prohibited") model = ifcopenshell.file() wall = model.createIfcSlab(Name="Waldo") - run("Prohibited specifications fail if at least one entity passes all requirements 1/3", specs, model, True) + run("Prohibited specifications fail if at least one entity is applicable 1/3", specs, model, True) model = ifcopenshell.file() wall = model.createIfcWall(Name="Wally") run( - "Prohibited specifications fail if at least one entity passes all requirements 2/3", + "Prohibited specifications fail if at least one entity is applicable 2/3", specs, model, True, - [wall], + [], [], ) model = ifcopenshell.file() wall = model.createIfcWall(Name="Waldo") run( - "Prohibited specifications fail if at least one entity passes all requirements 3/3", + "Prohibited specifications fail if at least one entity is applicable 3/3", specs, model, False, [wall], - [wall], + [], ) spec.set_usage("optional")