Minor fix

This commit is contained in:
Dion Moult
2022-10-09 22:26:38 +11:00
parent ab31fd7e48
commit d847f358ba
2 changed files with 7 additions and 3 deletions
+1
View File
@@ -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:
+6 -3
View File
@@ -17,6 +17,7 @@
# along with IfcTester. If not, see <http://www.gnu.org/licenses/>.
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,
)