Fixed issue with float vectors assertion during tests

`sequence.feature` - Added `[:]` to make errors more readable values in errors (for example, (0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 1.0) instead of `<bpy_float[4], Object.color>`

`test_feature.py` - fixed `FAILED test/bim/test_feature.py::test_animate_the_consumption_of_a_wall - AssertionError: Value is <bpy_float[4], Object.color>`
Test was failing because of float garbage in object.color (the comparison was (0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 1.0) <> [0.2, 0.2, 0.2, 1] )

After that fix all tests now are passed 🥲
This commit is contained in:
Andrej730
2023-02-20 18:11:08 +05:00
parent 0e1689c2d9
commit 1dfabe2591
2 changed files with 25 additions and 17 deletions
@@ -365,9 +365,9 @@ Scenario: Animate the construction of a wall
When I am on frame "2"
Then "scene.objects.get('IfcWall/Cube').hide_viewport" is "False"
And "scene.objects.get('IfcWall/Cube').hide_render" is "False"
And "scene.objects.get('IfcWall/Cube').color" is "[0.0, 1.0, 0.0, 1]"
And "scene.objects.get('IfcWall/Cube').color[:]" is "[0.0, 1.0, 0.0, 1]"
When I am on frame "7"
Then "scene.objects.get('IfcWall/Cube').color" is "[1.0, 1.0, 1.0, 1]"
Then "scene.objects.get('IfcWall/Cube').color[:]" is "[1.0, 1.0, 1.0, 1]"
Scenario: Animate the demolition of a wall
Given an empty IFC project
@@ -398,15 +398,15 @@ Scenario: Animate the demolition of a wall
When I am on frame "1"
Then "scene.objects.get('IfcWall/Cube').hide_viewport" is "False"
And "scene.objects.get('IfcWall/Cube').hide_render" is "False"
And "scene.objects.get('IfcWall/Cube').color" is "[1.0, 1.0, 1.0, 1]"
And "scene.objects.get('IfcWall/Cube').color[:]" is "[1.0, 1.0, 1.0, 1]"
When I am on frame "2"
Then "scene.objects.get('IfcWall/Cube').hide_viewport" is "False"
And "scene.objects.get('IfcWall/Cube').hide_render" is "False"
And "scene.objects.get('IfcWall/Cube').color" is "[1.0, 0.0, 0.0, 1]"
And "scene.objects.get('IfcWall/Cube').color[:]" is "[1.0, 0.0, 0.0, 1]"
When I am on frame "7"
Then "scene.objects.get('IfcWall/Cube').hide_viewport" is "True"
And "scene.objects.get('IfcWall/Cube').hide_render" is "True"
And "scene.objects.get('IfcWall/Cube').color" is "[0.0, 0.0, 0.0, 1]"
And "scene.objects.get('IfcWall/Cube').color[:]" is "[0.0, 0.0, 0.0, 1]"
Scenario: Animate the operation of a wall
Given an empty IFC project
@@ -435,11 +435,11 @@ Scenario: Animate the operation of a wall
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "P1W"
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
When I am on frame "1"
Then "scene.objects.get('IfcWall/Cube').color" is "[1.0, 1.0, 1.0, 1]"
Then "scene.objects.get('IfcWall/Cube').color[:]" is "[1.0, 1.0, 1.0, 1]"
When I am on frame "2"
Then "scene.objects.get('IfcWall/Cube').color" is "[0.0, 0.0, 1.0, 1]"
Then "scene.objects.get('IfcWall/Cube').color[:]" is "[0.0, 0.0, 1.0, 1]"
When I am on frame "7"
Then "scene.objects.get('IfcWall/Cube').color" is "[1.0, 1.0, 1.0, 1]"
Then "scene.objects.get('IfcWall/Cube').color[:]" is "[1.0, 1.0, 1.0, 1]"
Scenario: Animate the movement of a wall
Given an empty IFC project
@@ -475,23 +475,23 @@ Scenario: Animate the movement of a wall
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "P1W"
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
When I am on frame "1"
Then "scene.objects.get('IfcWall/FromObject').color" is "[1.0, 1.0, 1.0, 1]"
Then "scene.objects.get('IfcWall/FromObject').color[:]" is "[1.0, 1.0, 1.0, 1]"
And "scene.objects.get('IfcWall/FromObject').hide_viewport" is "False"
And "scene.objects.get('IfcWall/FromObject').hide_render" is "False"
And "scene.objects.get('IfcWall/ToObject').hide_viewport" is "True"
And "scene.objects.get('IfcWall/ToObject').hide_render" is "True"
When I am on frame "2"
Then "scene.objects.get('IfcWall/FromObject').color" is "[1.0, 0.5, 0.0, 1]"
Then "scene.objects.get('IfcWall/FromObject').color[:]" is "[1.0, 0.5, 0.0, 1]"
And "scene.objects.get('IfcWall/FromObject').hide_viewport" is "False"
And "scene.objects.get('IfcWall/FromObject').hide_render" is "False"
And "scene.objects.get('IfcWall/ToObject').color" is "[1.0, 1.0, 0.0, 1]"
And "scene.objects.get('IfcWall/ToObject').color[:]" is "[1.0, 1.0, 0.0, 1]"
And "scene.objects.get('IfcWall/ToObject').hide_viewport" is "False"
And "scene.objects.get('IfcWall/ToObject').hide_render" is "False"
When I am on frame "7"
Then "scene.objects.get('IfcWall/FromObject').color" is "[0.0, 0.0, 0.0, 1]"
Then "scene.objects.get('IfcWall/FromObject').color[:]" is "[0.0, 0.0, 0.0, 1]"
Then "scene.objects.get('IfcWall/FromObject').hide_viewport" is "True"
Then "scene.objects.get('IfcWall/FromObject').hide_render" is "True"
And "scene.objects.get('IfcWall/ToObject').color" is "[1.0, 1.0, 1.0, 1]"
And "scene.objects.get('IfcWall/ToObject').color[:]" is "[1.0, 1.0, 1.0, 1]"
And "scene.objects.get('IfcWall/ToObject').hide_viewport" is "False"
And "scene.objects.get('IfcWall/ToObject').hide_render" is "False"
@@ -519,15 +519,15 @@ Scenario: Animate the consumption of a wall
And I set "scene.BIMWorkScheduleProperties.speed_real_duration" to "P1W"
And I press "bim.visualise_work_schedule_date_range(work_schedule={work_schedule})"
When I am on frame "1"
Then "scene.objects.get('IfcWall/Cube').color" is "[1.0, 1.0, 1.0, 1]"
Then "scene.objects.get('IfcWall/Cube').color[:]" is "[1.0, 1.0, 1.0, 1]"
And "scene.objects.get('IfcWall/Cube').hide_viewport" is "False"
And "scene.objects.get('IfcWall/Cube').hide_render" is "False"
When I am on frame "2"
Then "scene.objects.get('IfcWall/Cube').color" is "[0.2, 0.2, 0.2, 1]"
Then "scene.objects.get('IfcWall/Cube').color[:]" is "[0.2, 0.2, 0.2, 1]"
And "scene.objects.get('IfcWall/Cube').hide_viewport" is "False"
And "scene.objects.get('IfcWall/Cube').hide_render" is "False"
When I am on frame "7"
Then "scene.objects.get('IfcWall/Cube').color" is "[0.0, 0.0, 0.0, 1]"
Then "scene.objects.get('IfcWall/Cube').color[:]" is "[0.0, 0.0, 0.0, 1]"
Then "scene.objects.get('IfcWall/Cube').hide_viewport" is "True"
Then "scene.objects.get('IfcWall/Cube').hide_render" is "True"