Skip to content

Commit 6da51c2

Browse files
committed
Update IfcTester to support changed upstream spec where prohibited specs cannot have requirements.
1 parent 53def55 commit 6da51c2

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/ifctester/ifctester/facet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def to_string(
136136
elif requirement.cardinality == "prohibited":
137137
templates = self.prohibited_templates
138138
elif requirement.cardinality == "optional":
139+
templates = self.requirement_templates
139140
templates = [
140141
t.replace("shall", "may").replace("Shall", "May").replace("must", "may") for t in templates
141142
]

src/ifctester/test/test_ids.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,29 +170,34 @@ def test_creating_a_minimal_ids_and_validating(self):
170170
waldo = model.createIfcSlab(Name="Waldo")
171171
run("Optional specifications may still pass if nothing is applicable", specs, model, True)
172172

173+
specs = ids.Ids(title="Title")
174+
spec = ids.Specification(name="Name")
175+
spec.applicability.append(ids.Entity(name="IFCWALL"))
176+
spec.applicability.append(ids.Attribute(name="Name", value="Waldo"))
177+
specs.specifications.append(spec)
173178
spec.set_usage("prohibited")
174179
model = ifcopenshell.file()
175180
wall = model.createIfcSlab(Name="Waldo")
176-
run("Prohibited specifications fail if at least one entity passes all requirements 1/3", specs, model, True)
181+
run("Prohibited specifications fail if at least one entity is applicable 1/3", specs, model, True)
177182
model = ifcopenshell.file()
178183
wall = model.createIfcWall(Name="Wally")
179184
run(
180-
"Prohibited specifications fail if at least one entity passes all requirements 2/3",
185+
"Prohibited specifications fail if at least one entity is applicable 2/3",
181186
specs,
182187
model,
183188
True,
184-
[wall],
189+
[],
185190
[],
186191
)
187192
model = ifcopenshell.file()
188193
wall = model.createIfcWall(Name="Waldo")
189194
run(
190-
"Prohibited specifications fail if at least one entity passes all requirements 3/3",
195+
"Prohibited specifications fail if at least one entity is applicable 3/3",
191196
specs,
192197
model,
193198
False,
194199
[wall],
195-
[wall],
200+
[],
196201
)
197202

198203
spec.set_usage("optional")

0 commit comments

Comments
 (0)