mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
44ce7c7e8a
- to avoid some diffs on regeneration - some fixtures had problems with the header, so `fail` for them wasn't really testing the intended case, because small issues in the header would make fixture fail regardless
21 lines
704 B
Python
21 lines
704 B
Python
import ifcopenshell
|
|
from generate import normalize_header
|
|
|
|
cases = (
|
|
("pass", "label-values", ("test1", "test2")),
|
|
("pass", "nil-values", None),
|
|
("fail", "distinct-value-types", ("test1", 2)),
|
|
)
|
|
|
|
for result, name, values in cases:
|
|
ifc_file = ifcopenshell.file(schema="IFC4X3")
|
|
list_values = None
|
|
if values is not None:
|
|
list_values = [
|
|
ifc_file.create_entity("IfcInteger", v) if isinstance(v, int) else ifc_file.create_entity("IfcLabel", v)
|
|
for v in values
|
|
]
|
|
ifc_file.create_entity("IfcPropertyListValue", Name="Test", ListValues=list_values)
|
|
normalize_header(ifc_file)
|
|
ifc_file.write(f"{result}-property-list-value-{name}.ifc")
|