From 5964160d67e7969ed46f3a4f75225ad2f9b3bc1e Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 3 Aug 2026 15:44:33 +0500 Subject: [PATCH] rule fixtures: add missing generation scripts --- .../test/fixtures/rules/generate_26.py | 18 ++++++++++++++++++ .../test/fixtures/rules/generate_27.py | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/ifcopenshell-python/test/fixtures/rules/generate_26.py create mode 100644 src/ifcopenshell-python/test/fixtures/rules/generate_27.py diff --git a/src/ifcopenshell-python/test/fixtures/rules/generate_26.py b/src/ifcopenshell-python/test/fixtures/rules/generate_26.py new file mode 100644 index 0000000000..bcfe7f4055 --- /dev/null +++ b/src/ifcopenshell-python/test/fixtures/rules/generate_26.py @@ -0,0 +1,18 @@ +import ifcopenshell + +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) + ifc_file.write(f"{result}-property-list-value-{name}.ifc") diff --git a/src/ifcopenshell-python/test/fixtures/rules/generate_27.py b/src/ifcopenshell-python/test/fixtures/rules/generate_27.py new file mode 100644 index 0000000000..40096d5cca --- /dev/null +++ b/src/ifcopenshell-python/test/fixtures/rules/generate_27.py @@ -0,0 +1,8 @@ +import ifcopenshell + +ifc_file = ifcopenshell.file(schema="IFC2X3") +ifc_file.create_entity( + "IfcCurveStyle", + CurveWidth=ifc_file.create_entity("IfcDescriptiveMeasure", "by layer"), +) +ifc_file.write("pass-IfcCurveStyle-ifc2x3.ifc")