fix linked ifc visibility toggle tests

This commit is contained in:
Andrej730
2024-03-25 12:17:38 +05:00
parent 54fefb3684
commit f0dde4f825
4 changed files with 53 additions and 13 deletions
@@ -331,9 +331,13 @@ Scenario: Toggle link visibility - wireframe mode
Scenario: Toggle link visibility - visible mode
Given an empty IFC project
And I press "bim.link_ifc(filepath='{cwd}/test/files/basic.blend')"
When I press "bim.toggle_link_visibility(link='{cwd}/test/files/basic.blend', mode='VISIBLE')"
Then nothing happens
And I press "bim.link_ifc(filepath='{cwd}/test/files/basic.ifc')"
When I press "bim.toggle_link_visibility(link='{cwd}/test/files/basic.ifc', mode='VISIBLE')"
Then "scene.BIMProjectProperties.links['{cwd}/test/files/basic.ifc'].is_hidden" is "True"
And the collection "IfcProject/basic.ifc" exclude status is "True"
When I press "bim.toggle_link_visibility(link='{cwd}/test/files/basic.ifc', mode='VISIBLE')"
Then "scene.BIMProjectProperties.links['{cwd}/test/files/basic.ifc'].is_hidden" is "False"
And the collection "IfcProject/basic.ifc" exclude status is "False"
Scenario: Unload link
Given an empty Blender session
+15
View File
@@ -397,6 +397,21 @@ def the_collection_name_exists(name) -> bpy.types.Collection:
return obj
@then(parsers.parse('the collection "{name}" exists in viewlayer'))
def the_collection_exists_in_viewlayer(name: str) -> bpy.types.LayerCollection:
col = the_collection_name_exists(name)
layer = tool.Blender.get_layer_collection(col)
if not layer:
assert False, f'The collection "{name}" is not present in the current viewlayer'
return layer
@then(parsers.parse('the collection "{name}" exclude status is "{exclude}"'))
def the_collection_exclude_status_is(name: str, exclude: str) -> None:
layer = the_collection_exists_in_viewlayer(name)
assert layer.exclude == (exclude == "True")
@then(parsers.parse('the object "{name1}" and "{name2}" are different elements'))
def the_object_name1_and_name2_are_different_elements(name1, name2):
ifc = an_ifc_file_exists()