mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-29 11:46:33 +00:00
Update IfcTester to support changed upstream spec where prohibited specs cannot have requirements.
This commit is contained in:
@@ -136,6 +136,7 @@ class Facet:
|
|||||||
elif requirement.cardinality == "prohibited":
|
elif requirement.cardinality == "prohibited":
|
||||||
templates = self.prohibited_templates
|
templates = self.prohibited_templates
|
||||||
elif requirement.cardinality == "optional":
|
elif requirement.cardinality == "optional":
|
||||||
|
templates = self.requirement_templates
|
||||||
templates = [
|
templates = [
|
||||||
t.replace("shall", "may").replace("Shall", "May").replace("must", "may") for t in templates
|
t.replace("shall", "may").replace("Shall", "May").replace("must", "may") for t in templates
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -170,29 +170,34 @@ class TestIds:
|
|||||||
waldo = model.createIfcSlab(Name="Waldo")
|
waldo = model.createIfcSlab(Name="Waldo")
|
||||||
run("Optional specifications may still pass if nothing is applicable", specs, model, True)
|
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")
|
spec.set_usage("prohibited")
|
||||||
model = ifcopenshell.file()
|
model = ifcopenshell.file()
|
||||||
wall = model.createIfcSlab(Name="Waldo")
|
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()
|
model = ifcopenshell.file()
|
||||||
wall = model.createIfcWall(Name="Wally")
|
wall = model.createIfcWall(Name="Wally")
|
||||||
run(
|
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,
|
specs,
|
||||||
model,
|
model,
|
||||||
True,
|
True,
|
||||||
[wall],
|
[],
|
||||||
[],
|
[],
|
||||||
)
|
)
|
||||||
model = ifcopenshell.file()
|
model = ifcopenshell.file()
|
||||||
wall = model.createIfcWall(Name="Waldo")
|
wall = model.createIfcWall(Name="Waldo")
|
||||||
run(
|
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,
|
specs,
|
||||||
model,
|
model,
|
||||||
False,
|
False,
|
||||||
[wall],
|
[wall],
|
||||||
[wall],
|
[],
|
||||||
)
|
)
|
||||||
|
|
||||||
spec.set_usage("optional")
|
spec.set_usage("optional")
|
||||||
|
|||||||
Reference in New Issue
Block a user