From 1f637660d1d8becdafc2662212769e7b4d1c1aec Mon Sep 17 00:00:00 2001 From: Carlos Villagrasa Date: Mon, 1 Aug 2022 22:04:59 +0200 Subject: [PATCH] model and geometry module tests fixed --- src/blenderbim/test/bim/feature/model.feature | 18 ++++++------ src/blenderbim/test/bim/test_feature.py | 28 +++---------------- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/src/blenderbim/test/bim/feature/model.feature b/src/blenderbim/test/bim/feature/model.feature index cd950f888d..0db26c92c5 100644 --- a/src/blenderbim/test/bim/feature/model.feature +++ b/src/blenderbim/test/bim/feature/model.feature @@ -53,11 +53,9 @@ Scenario: Preview one type on the Construction Type Browser And I load the demo construction library When I display the construction type browser And I preview only one asset on the construction type browser - And I set "scene.BIMModelProperties.ifc_class_browser" to "IfcColumnType" - And I set "scene.BIMModelProperties.relating_type_browser" to "DEMO2" - And I select the browser construction type - Then "scene.BIMModelProperties.ifc_class" is "IfcColumnType" - And construction type is DEMO2 + And I set "scene.BIMModelProperties.ifc_class" to "IfcColumnType" + And I set "scene.BIMModelProperties.relating_type" to "DEMO2" + Then construction type is DEMO2 And objects starting with "IfcColumn/" do not exist And the construction type "IfcColumnType"/"DEMO2" has a preview @@ -66,8 +64,8 @@ Scenario: Preview one class on the construction type browser And I load the demo construction library When I display the construction type browser And I preview all available assets on the construction type browser - And I set "scene.BIMModelProperties.ifc_class_browser" to "IfcWallType" - Then "scene.BIMModelProperties.ifc_class_browser" is "IfcWallType" + And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType" + Then "scene.BIMModelProperties.ifc_class" is "IfcWallType" And objects starting with "IfcWall/" do not exist And all construction types for "IfcWallType" have a preview @@ -76,9 +74,9 @@ Scenario: Add one type from the Construction Type Browser And I load the demo construction library When I display the construction type browser And I preview only one asset on the construction type browser - And I set "scene.BIMModelProperties.ifc_class_browser" to "IfcColumnType" - And I set "scene.BIMModelProperties.relating_type_browser" to "DEMO2" - And I add the browser construction type + And I set "scene.BIMModelProperties.ifc_class" to "IfcColumnType" + And I set "scene.BIMModelProperties.relating_type" to "DEMO2" + And I add the construction type Then the object "IfcColumn/Column" exists Scenario: Add grid diff --git a/src/blenderbim/test/bim/test_feature.py b/src/blenderbim/test/bim/test_feature.py index 3d05203e5a..87409c5798 100644 --- a/src/blenderbim/test/bim/test_feature.py +++ b/src/blenderbim/test/bim/test_feature.py @@ -626,7 +626,7 @@ def i_add_a_construction_library(): @given("I display the construction type browser") @when("I display the construction type browser") def i_display_the_construction_type_browser(): - bpy.ops.bim.display_relating_types("INVOKE_DEFAULT") + bpy.ops.bim.display_constr_types("INVOKE_DEFAULT") @given("I preview only one asset on the construction type browser") @@ -641,32 +641,12 @@ def i_preview_all_construction_types(): bpy.context.scene.BIMModelProperties.unfold_relating_types = True -@given("I select the browser construction type") -@when("I select the browser construction type") -def i_select_the_active_construction_type(): - props = bpy.context.scene.BIMModelProperties - bpy.ops.bim.select_construction_type( - ifc_class=props.ifc_class_browser, relating_type_id=props.relating_type_id_browser - ) - - -@given("I add the browser construction type") -@when("I add the browser construction type") +@given("I add the construction type") +@when("I add the construction type") def i_add_the_active_construction_type(): props = bpy.context.scene.BIMModelProperties bpy.ops.bim.add_constr_type_instance( - ifc_class=props.ifc_class_browser, relating_type_id=int(props.relating_type_id_browser) - ) - - -@then(parsers.parse("browser construction type is {relating_type_name}")) -def browser_construction_type(relating_type_name): - props = bpy.context.scene.BIMModelProperties - relating_type_browser = AuthoringData.relating_type_name_by_id( - props.ifc_class_browser, props.relating_type_id_browser - ) - assert relating_type_browser == relating_type_name, ( - f"Construction Type is a {relating_type_browser}, not " + f"a {relating_type_name}" + ifc_class=props.ifc_class, relating_type_id=int(props.relating_type_id) )