From 36c52b3bea8c93578db86ad6bb0bd673aebf9560 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 2 Aug 2017 16:09:20 +0200 Subject: [PATCH] Update tests --- test/tests.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/tests.py b/test/tests.py index df0d69d9ac..1a6a85db45 100644 --- a/test/tests.py +++ b/test/tests.py @@ -46,6 +46,19 @@ assert f[16].UnitComponent is None prop = f.by_type("IfcPropertySingleValue")[0] assert prop.NominalValue.wrappedValue in str(prop) +# An instance added to a new file yields the same string +# representation, except for any instance name identifiers. +f2 = ifcopenshell.open() +prop2 = f2.add(prop) +assert str(prop) == str(prop2).replace(str(prop2.id()), str(prop.id())) +assert prop2.id() == 1 + +# A recursively obtained python dictionary representation +# matches for copied instances as well +app = f.by_type("IfcApplication")[0] +assert f2.add(app).get_info(False, True) == app.get_info(False, True) +assert "Version" in dir(app) + # Some operations on ifcopenshell.entity_instance assert f[22].Id == '' assert f[22].Addresses is None