Fix regression where adding a new occurrence should not change your active context back to body if you've switched it.

This commit is contained in:
Dion Moult
2025-02-07 23:52:55 +11:00
parent 49c3a55456
commit 7bc1992963
2 changed files with 13 additions and 3 deletions
+3 -2
View File
@@ -733,8 +733,9 @@ def the_object_name_has_a_representation_type_of_context(name, type, context):
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
context, subcontext, target_view = context.split("/")
rep = ifcopenshell.util.representation.get_representation(element, context, subcontext or None, target_view or None)
rep =ifcopenshell.util.representation.resolve_representation(rep)
assert rep
assert rep.RepresentationType == type
assert rep.RepresentationType == type, f"The object {name} does not have a {type} representation"
@given(parsers.parse('the object "{name}" data is a "{type}" representation of "{context}"'))
@@ -744,7 +745,7 @@ def the_object_name_data_is_a_type_representation_of_context(name, type, context
context, subcontext, target_view = context.split("/")
rep = ifc.by_id(the_object_name_exists(name).data.BIMMeshProperties.ifc_definition_id)
assert rep
assert rep.RepresentationType == type
assert rep.RepresentationType == type, f"The object {name} is not a {type} representation"
assert rep.ContextOfItems.ContextType == context
assert rep.ContextOfItems.ContextIdentifier == subcontext
assert rep.ContextOfItems.TargetView == target_view