From a37c87cf4ce7552786ef1b9c38136b2078e60ad0 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 27 Mar 2024 15:23:46 +0500 Subject: [PATCH] Fix tests involving changes in Blender 4.1 (will fail on Blender <4.1) Basically in Blender 4.1 they've changed a way renaming IDs works if name already existed before and those tests will stop working on Blender <4.1, see https://projects.blender.org/blender/blender/issues/119955 --- .../test/bim/feature/geometry.feature | 18 ++-- src/blenderbim/test/bim/feature/model.feature | 84 +++++++++---------- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/src/blenderbim/test/bim/feature/geometry.feature b/src/blenderbim/test/bim/feature/geometry.feature index f4a00fa4cf..8e5a8c7214 100644 --- a/src/blenderbim/test/bim/feature/geometry.feature +++ b/src/blenderbim/test/bim/feature/geometry.feature @@ -477,17 +477,17 @@ Scenario: Override duplicate move - copying walls with mitre joint And I press "bim.hotkey(hotkey='S_A')" And the cursor is at "0.5,0,0" And I press "bim.hotkey(hotkey='S_A')" - And the object "IfcWall/Wall" is selected - And additionally the object "IfcWall/Wall.001" is selected + And the object "IfcWall/Wall.001" is selected + And additionally the object "IfcWall/Wall" is selected When I press "bim.hotkey(hotkey='S_Y')" - Then the object "IfcWall/Wall.001" dimensions are "0.5,0.1,3" - And the object "IfcWall/Wall.001" bottom left corner is at "0.5,0,0" - And the object "IfcWall/Wall" dimensions are "1.1,0.1,3" - And the object "IfcWall/Wall" bottom left corner is at "0.5,0.1,0" - And the object "IfcWall/Wall" top right corner is at "0.6,-1,3" + Then the object "IfcWall/Wall" dimensions are "0.5,0.1,3" + And the object "IfcWall/Wall" bottom left corner is at "0.5,0,0" + And the object "IfcWall/Wall.001" dimensions are "1.1,0.1,3" + And the object "IfcWall/Wall.001" bottom left corner is at "0.5,0.1,0" + And the object "IfcWall/Wall.001" top right corner is at "0.6,-1,3" When I deselect all objects - And the object "IfcWall/Wall" is selected - And additionally the object "IfcWall/Wall.001" is selected + And the object "IfcWall/Wall.001" is selected + And additionally the object "IfcWall/Wall" is selected When I duplicate the selected objects Then the object "IfcWall/Wall.002" exists And the variable "wall_name1" is "[o.name for o in bpy.context.selected_objects if o.name == 'IfcWall/Wall.002'][0]" diff --git a/src/blenderbim/test/bim/feature/model.feature b/src/blenderbim/test/bim/feature/model.feature index bdaa4a45f0..bf9208b012 100644 --- a/src/blenderbim/test/bim/feature/model.feature +++ b/src/blenderbim/test/bim/feature/model.feature @@ -107,11 +107,11 @@ Scenario: Add a wall perpendicular to an existing wall And I press "bim.hotkey(hotkey='S_A')" And the cursor is at "0.5,0,0" When I press "bim.hotkey(hotkey='S_A')" - Then the object "IfcWall/Wall.001" dimensions are "1,0.1,3" - And the object "IfcWall/Wall.001" bottom left corner is at "0,0,0" - And the object "IfcWall/Wall" dimensions are "1,0.1,3" - And the object "IfcWall/Wall" bottom left corner is at "0.5,0,0" - And the object "IfcWall/Wall" top right corner is at "0.6,-1,3" + Then the object "IfcWall/Wall" dimensions are "1,0.1,3" + And the object "IfcWall/Wall" bottom left corner is at "0,0,0" + And the object "IfcWall/Wall.001" dimensions are "1,0.1,3" + And the object "IfcWall/Wall.001" bottom left corner is at "0.5,0,0" + And the object "IfcWall/Wall.001" top right corner is at "0.6,-1,3" Scenario: Extend one wall to another Given an empty IFC project @@ -122,35 +122,17 @@ Scenario: Extend one wall to another And I press "bim.hotkey(hotkey='S_A')" And the cursor is at "0.5,0,0" And I press "bim.hotkey(hotkey='S_A')" - And the object "IfcWall/Wall" is moved to "0.5,-1,0" - And the object "IfcWall/Wall" is selected - And additionally the object "IfcWall/Wall.001" is selected + And the object "IfcWall/Wall.001" is moved to "0.5,-1,0" + And the object "IfcWall/Wall.001" is selected + And additionally the object "IfcWall/Wall" is selected When I press "bim.hotkey(hotkey='S_E')" - Then the object "IfcWall/Wall.001" dimensions are "1,0.1,3" - And the object "IfcWall/Wall.001" bottom left corner is at "0,0,0" - And the object "IfcWall/Wall" dimensions are "2,0.1,3" - And the object "IfcWall/Wall" bottom left corner is at "0.5,0,0" - And the object "IfcWall/Wall" top right corner is at "0.6,-2,3" + Then the object "IfcWall/Wall" dimensions are "1,0.1,3" + And the object "IfcWall/Wall" bottom left corner is at "0,0,0" + And the object "IfcWall/Wall.001" dimensions are "2,0.1,3" + And the object "IfcWall/Wall.001" bottom left corner is at "0.5,0,0" + And the object "IfcWall/Wall.001" top right corner is at "0.6,-2,3" Scenario: Join two walls with a butt joint - first wall has priority - Given an empty IFC project - And I load the demo construction library - And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType" - And the variable "element_type" is "[e for e in {ifc}.by_type('IfcWallType') if e.Name == 'WAL100'][0].id()" - And I set "scene.BIMModelProperties.relating_type_id" to "{element_type}" - And I press "bim.hotkey(hotkey='S_A')" - And the cursor is at "0.5,0,0" - And I press "bim.hotkey(hotkey='S_A')" - And the object "IfcWall/Wall" is selected - And additionally the object "IfcWall/Wall.001" is selected - When I press "bim.hotkey(hotkey='S_T')" - Then the object "IfcWall/Wall.001" dimensions are "0.4,0.1,3" - And the object "IfcWall/Wall.001" bottom left corner is at "0.6,0,0" - And the object "IfcWall/Wall" dimensions are "1.1,0.1,3" - And the object "IfcWall/Wall" bottom left corner is at "0.5,0.1,0" - And the object "IfcWall/Wall" top right corner is at "0.6,-1,3" - -Scenario: Join two walls with a butt joint - second wall has priority Given an empty IFC project And I load the demo construction library And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType" @@ -162,13 +144,13 @@ Scenario: Join two walls with a butt joint - second wall has priority And the object "IfcWall/Wall.001" is selected And additionally the object "IfcWall/Wall" is selected When I press "bim.hotkey(hotkey='S_T')" - Then the object "IfcWall/Wall.001" dimensions are "0.5,0.1,3" - And the object "IfcWall/Wall.001" bottom left corner is at "0.5,0,0" - And the object "IfcWall/Wall" dimensions are "1,0.1,3" - And the object "IfcWall/Wall" bottom left corner is at "0.5,0,0" - And the object "IfcWall/Wall" top right corner is at "0.6,-1,3" + Then the object "IfcWall/Wall" dimensions are "0.4,0.1,3" + And the object "IfcWall/Wall" bottom left corner is at "0.6,0,0" + And the object "IfcWall/Wall.001" dimensions are "1.1,0.1,3" + And the object "IfcWall/Wall.001" bottom left corner is at "0.5,0.1,0" + And the object "IfcWall/Wall.001" top right corner is at "0.6,-1,3" -Scenario: Join two walls with a mitre joint +Scenario: Join two walls with a butt joint - second wall has priority Given an empty IFC project And I load the demo construction library And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType" @@ -179,12 +161,30 @@ Scenario: Join two walls with a mitre joint And I press "bim.hotkey(hotkey='S_A')" And the object "IfcWall/Wall" is selected And additionally the object "IfcWall/Wall.001" is selected - When I press "bim.hotkey(hotkey='S_Y')" - Then the object "IfcWall/Wall.001" dimensions are "0.5,0.1,3" + When I press "bim.hotkey(hotkey='S_T')" + Then the object "IfcWall/Wall" dimensions are "0.5,0.1,3" + And the object "IfcWall/Wall" bottom left corner is at "0.5,0,0" + And the object "IfcWall/Wall.001" dimensions are "1,0.1,3" And the object "IfcWall/Wall.001" bottom left corner is at "0.5,0,0" - And the object "IfcWall/Wall" dimensions are "1.1,0.1,3" - And the object "IfcWall/Wall" bottom left corner is at "0.5,0.1,0" - And the object "IfcWall/Wall" top right corner is at "0.6,-1,3" + And the object "IfcWall/Wall.001" top right corner is at "0.6,-1,3" + +Scenario: Join two walls with a mitre joint + Given an empty IFC project + And I load the demo construction library + And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType" + And the variable "element_type" is "[e for e in {ifc}.by_type('IfcWallType') if e.Name == 'WAL100'][0].id()" + And I set "scene.BIMModelProperties.relating_type_id" to "{element_type}" + And I press "bim.hotkey(hotkey='S_A')" + And the cursor is at "0.5,0,0" + And I press "bim.hotkey(hotkey='S_A')" + And the object "IfcWall/Wall.001" is selected + And additionally the object "IfcWall/Wall" is selected + When I press "bim.hotkey(hotkey='S_Y')" + Then the object "IfcWall/Wall" dimensions are "0.5,0.1,3" + And the object "IfcWall/Wall" bottom left corner is at "0.5,0,0" + And the object "IfcWall/Wall.001" dimensions are "1.1,0.1,3" + And the object "IfcWall/Wall.001" bottom left corner is at "0.5,0.1,0" + And the object "IfcWall/Wall.001" top right corner is at "0.6,-1,3" Scenario: Change the height of a wall Given an empty IFC project