Fix bug where predefined types aren't audited correctly by BIMTester

This commit is contained in:
Dion Moult
2020-08-18 13:36:07 +10:00
parent b6f51bc080
commit df382d3e64
@@ -16,8 +16,9 @@ def step_impl(context, guid, ifc_class):
@step('The element {guid} is further defined as a {predefined_type}')
def step_impl(context, guid, predefined_type):
element = IfcFile.by_guid(guid)
if (hasattr(element, 'PredefinedType') and element.PredefinedType == 'USERDEFINED') \
or hasattr(element,'ObjectType'):
if hasattr(element, 'PredefinedType') \
and element.PredefinedType == 'USERDEFINED' \
and hasattr(element,'ObjectType'):
assert_attribute(element, 'ObjectType', predefined_type)
elif hasattr(element, 'PredefinedType'):
assert_attribute(element, 'PredefinedType', predefined_type)