mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
Assigning aggregations now protects against various invalid aggregation combinations
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
@aggregate
|
||||
Feature: Aggregate
|
||||
Covers element and spatial aggregation
|
||||
|
||||
Scenario: Enable editing aggregate
|
||||
Given an empty IFC project
|
||||
And the object "IfcSite/My Site" is selected
|
||||
When I press "bim.enable_editing_aggregate"
|
||||
Then nothing happens
|
||||
|
||||
Scenario: Disable editing aggregate
|
||||
Given an empty IFC project
|
||||
And the object "IfcSite/My Site" is selected
|
||||
And I press "bim.enable_editing_aggregate"
|
||||
When I press "bim.disable_editing_aggregate"
|
||||
Then nothing happens
|
||||
|
||||
Scenario: Assign object
|
||||
Given an empty IFC project
|
||||
And the object "IfcSite/My Site" is selected
|
||||
And I press "bim.enable_editing_aggregate"
|
||||
And the variable "relating_object" is "tool.Ifc.get().by_type('IfcSite')[0].id()"
|
||||
And the variable "related_object" is "tool.Ifc.get().by_type('IfcBuildingStorey')[0].id()"
|
||||
When I press "bim.assign_object(relating_object={relating_object}, related_object={related_object})"
|
||||
Then the object "IfcSite/My Site" is in the collection "IfcSite/My Site"
|
||||
Then the object "IfcBuildingStorey/My Storey" is in the collection "IfcBuildingStorey/My Storey"
|
||||
Then the collection "IfcBuildingStorey/My Storey" is in the collection "IfcSite/My Site"
|
||||
|
||||
@@ -262,3 +262,8 @@ def prop_is_value(prop, value):
|
||||
@then(parsers.parse('the object "{name}" is in the collection "{collection}"'))
|
||||
def the_object_name_is_in_the_collection_collection(name, collection):
|
||||
assert collection in [c.name for c in the_object_name_exists(name).users_collection]
|
||||
|
||||
|
||||
@then(parsers.parse('the collection "{name1}" is in the collection "{name2}"'))
|
||||
def the_collection_name1_is_in_the_collection_name2(name1, name2):
|
||||
assert bpy.data.collections.get(name2).children.get(name1)
|
||||
|
||||
Reference in New Issue
Block a user