From d847f358ba148403a7aea3cb31c8ac268347f047 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 9 Oct 2022 22:26:38 +1100 Subject: [PATCH] Minor fix --- src/ifcfm/ifcfm/util.py | 1 + src/ifctester/test/test_facet.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ifcfm/ifcfm/util.py b/src/ifcfm/ifcfm/util.py index 8772285952..199b280b6e 100644 --- a/src/ifcfm/ifcfm/util.py +++ b/src/ifcfm/ifcfm/util.py @@ -38,6 +38,7 @@ def print_element(declaration, should_print_subtypes=True): types.remove("NOTDEFINED") print("{}".format(declaration.name())) if types: + types = sorted(types) for line in textwrap.wrap(", ".join(types), width=70): print("\t\t{}".format(line)) if should_print_subtypes: diff --git a/src/ifctester/test/test_facet.py b/src/ifctester/test/test_facet.py index a1afc8074f..bf4453f03a 100644 --- a/src/ifctester/test/test_facet.py +++ b/src/ifctester/test/test_facet.py @@ -17,6 +17,7 @@ # along with IfcTester. If not, see . +import uuid import ifcopenshell import ifcopenshell.api from ifctester.facet import Entity, Attribute, Classification, Property, PartOf, Material, Restriction @@ -414,13 +415,15 @@ class TestAttribute: expected=False, ) - global_id = ifcopenshell.guid.new() - facet = Attribute(name="GlobalId", value=global_id) ifc = ifcopenshell.file() + ns = uuid.UUID("b59aa156-82a4-4b4c-a6e5-3d04a0236af9") + element = ifc.createIfcWall() + element.GlobalId = ifcopenshell.guid.compress(uuid.uuid5(ns, str(element.id())).hex) + facet = Attribute(name="GlobalId", value=element.GlobalId) run( "GlobalIds are treated as strings and not expanded", facet=facet, - inst=ifc.createIfcWall(GlobalId=global_id), + inst=element, expected=True, )