You can now manage actor assignments to products

This commit is contained in:
Dion Moult
2022-05-06 17:47:24 +10:00
parent b54caa8967
commit 5f1b5d0c63
12 changed files with 331 additions and 2 deletions
@@ -277,3 +277,30 @@ Scenario: Edit actor
And I press "bim.enable_editing_actor(actor={actor})"
When I press "bim.edit_actor"
Then "scene.BIMOwnerProperties.active_actor_id" is "0"
Scenario: Assign actor
Given an empty IFC project
And I press "bim.add_person"
And I press "bim.add_actor"
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"
And the variable "actor" is "{ifc}.by_type('IfcActor')[0].id()"
And the object "IfcWall/Cube" is selected
When I press "bim.assign_actor(actor={actor})"
Then nothing happens
Scenario: Unassign actor
Given an empty IFC project
And I press "bim.add_person"
And I press "bim.add_actor"
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"
And the variable "actor" is "{ifc}.by_type('IfcActor')[0].id()"
And the object "IfcWall/Cube" is selected
And I press "bim.assign_actor(actor={actor})"
When I press "bim.unassign_actor(actor={actor})"
Then nothing happens
+12
View File
@@ -259,3 +259,15 @@ class TestEditActor:
ifc.run("owner.edit_actor", actor="actor", attributes="attributes").should_be_called()
owner.clear_actor().should_be_called()
subject.edit_actor(ifc, owner)
class TestAssignActor:
def test_run(self, ifc, owner):
ifc.run("owner.assign_actor", relating_actor="actor", related_object="element").should_be_called()
subject.assign_actor(ifc, actor="actor", element="element")
class TestUnassignActor:
def test_run(self, ifc, owner):
ifc.run("owner.unassign_actor", relating_actor="actor", related_object="element").should_be_called()
subject.unassign_actor(ifc, actor="actor", element="element")