Update tests

This commit is contained in:
Thomas Krijnen
2017-08-02 16:09:20 +02:00
parent ceff8a8822
commit 36c52b3bea
+13
View File
@@ -46,6 +46,19 @@ assert f[16].UnitComponent is None
prop = f.by_type("IfcPropertySingleValue")[0] prop = f.by_type("IfcPropertySingleValue")[0]
assert prop.NominalValue.wrappedValue in str(prop) 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 # Some operations on ifcopenshell.entity_instance
assert f[22].Id == '' assert f[22].Id == ''
assert f[22].Addresses is None assert f[22].Addresses is None