Fix #1745 : Test startup file contains no object

This commit is contained in:
Gorgious
2021-09-23 12:35:05 +02:00
parent 98cc0b93ce
commit 4868edaa83
4 changed files with 19 additions and 0 deletions
+3
View File
@@ -37,6 +37,9 @@ class NewFile:
def setup(self):
IfcStore.purge()
bpy.ops.wm.read_homefile(app_template="")
while bpy.data.objects:
bpy.data.objects.remove(bpy.data.objects[0])
bpy.ops.outliner.orphans_purge(do_local_ids=True, do_linked_ids=True, do_recursive=True)
def scenario(function):
@@ -24,6 +24,7 @@ class TestAssignClass(test.bim.bootstrap.NewFile):
def test_assigning_a_class_to_a_cube(self):
return """
Given an empty IFC project
Given I add a cube
When the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
@@ -36,6 +37,7 @@ class TestAssignClass(test.bim.bootstrap.NewFile):
def test_assigning_a_type_class_to_a_cube(self):
return """
Given an empty IFC project
Given I add a cube
When the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
@@ -49,6 +51,7 @@ class TestAssignClass(test.bim.bootstrap.NewFile):
def test_assigning_a_spatial_class_to_a_cube(self):
return """
Given an empty IFC project
Given I add a cube
When the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_product" to "IfcSpatialElement"
And I set "scene.BIMRootProperties.ifc_class" to "IfcBuilding"
@@ -62,6 +65,7 @@ class TestAssignClass(test.bim.bootstrap.NewFile):
def test_assigning_an_opening_class_to_a_cube(self):
return """
Given an empty IFC project
Given I add a cube
When the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
And I set "scene.BIMRootProperties.ifc_class" to "IfcOpeningElement"
@@ -76,6 +80,7 @@ class TestAssignClass(test.bim.bootstrap.NewFile):
def test_assigning_a_class_to_a_cube_in_a_collection(self):
return """
Given an empty IFC project
Given I add a cube
When the object "Cube" is selected
And the object "Cube" is placed in the collection "IfcBuildingStorey/My Storey"
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
@@ -89,6 +94,7 @@ class TestCopyClass(test.bim.bootstrap.NewFile):
def test_copying_a_wall(self):
return """
Given an empty IFC project
Given I add a cube
When the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
@@ -112,6 +118,7 @@ class TestCopyClass(test.bim.bootstrap.NewFile):
def test_copying_an_opening(self):
return """
Given an empty IFC project
Given I add a cube
When the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
@@ -52,6 +52,7 @@ class TestVisualiseWorkScheduleDateRange(test.bim.bootstrap.NewFile):
And I set "scene.BIMWorkScheduleProperties.task_time_attributes.get("ScheduleStart").string_value" to "2021-01-02"
And I set "scene.BIMWorkScheduleProperties.task_time_attributes.get("ScheduleFinish").string_value" to "2021-01-06"
And I press "bim.edit_task_time"
And I add a cube
And the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
@@ -88,6 +89,7 @@ class TestVisualiseWorkScheduleDateRange(test.bim.bootstrap.NewFile):
And I set "scene.BIMWorkScheduleProperties.task_time_attributes.get("ScheduleStart").string_value" to "2021-01-02"
And I set "scene.BIMWorkScheduleProperties.task_time_attributes.get("ScheduleFinish").string_value" to "2021-01-06"
And I press "bim.edit_task_time"
And I add a cube
And the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
@@ -127,6 +129,7 @@ class TestVisualiseWorkScheduleDateRange(test.bim.bootstrap.NewFile):
And I set "scene.BIMWorkScheduleProperties.task_time_attributes.get("ScheduleStart").string_value" to "2021-01-02"
And I set "scene.BIMWorkScheduleProperties.task_time_attributes.get("ScheduleFinish").string_value" to "2021-01-06"
And I press "bim.edit_task_time"
And I add a cube
And the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
@@ -211,6 +214,7 @@ class TestVisualiseWorkScheduleDateRange(test.bim.bootstrap.NewFile):
And I set "scene.BIMWorkScheduleProperties.task_time_attributes.get("ScheduleStart").string_value" to "2021-01-02"
And I set "scene.BIMWorkScheduleProperties.task_time_attributes.get("ScheduleFinish").string_value" to "2021-01-06"
And I press "bim.edit_task_time"
And I add a cube
And the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
@@ -24,6 +24,7 @@ class TestAddOpening(test.bim.bootstrap.NewFile):
def test_adding_an_opening(self):
return """
Given an empty IFC project
Given I add a cube
When the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
@@ -43,6 +44,7 @@ class TestRemoveOpening(test.bim.bootstrap.NewFile):
def test_removing_an_opening_manually(self):
return """
Given an empty IFC project
Given I add a cube
When the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
@@ -60,6 +62,7 @@ class TestRemoveOpening(test.bim.bootstrap.NewFile):
def test_removing_a_non_dynamic_opening_manually(self):
return """
Given an empty IFC project
Given I add a cube
When the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
@@ -80,6 +83,7 @@ class TestRemoveOpening(test.bim.bootstrap.NewFile):
def test_removing_an_opening_using_deletion(self):
return """
Given an empty IFC project
Given I add a cube
When the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
@@ -97,6 +101,7 @@ class TestRemoveOpening(test.bim.bootstrap.NewFile):
def test_removing_an_opening_indirectly_by_deleting_its_building_element(self):
return """
Given an empty IFC project
Given I add a cube
When the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"