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