mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
owner.remove_role - fix error handling resource level rel (fe1e307)
It's probably was just an overlook in the original commit - it was referring to `settings["organisation"]`, though `"organization"` was never passed, leading to an error. And probably by accident remove_role tests were using the same tests as remove_organization, so the issue went under the radar for a while.
This commit is contained in:
@@ -49,20 +49,21 @@ class TestRemoveRoleIFC2X3(test.bootstrap.IFC2X3):
|
||||
|
||||
|
||||
class TestRemoveRoleIFC4(test.bootstrap.IFC4, TestRemoveRoleIFC2X3):
|
||||
# IfcResourceLevelRelationships were added in IFC4.
|
||||
def test_deleting_resource_approval_relationships(self):
|
||||
organisation = self.file.create_entity("IfcOrganization")
|
||||
self.file.create_entity("IfcResourceApprovalRelationship", RelatedResourceObjects=[organisation])
|
||||
ifcopenshell.api.owner.remove_organisation(self.file, organisation=organisation)
|
||||
role = self.file.create_entity("IfcActorRole")
|
||||
self.file.create_entity("IfcResourceApprovalRelationship", RelatedResourceObjects=[role])
|
||||
ifcopenshell.api.owner.remove_role(self.file, role=role)
|
||||
assert len(self.file.by_type("IfcResourceApprovalRelationship")) == 0
|
||||
|
||||
def test_deleting_resource_constraint_relationships(self):
|
||||
organisation = self.file.create_entity("IfcOrganization")
|
||||
self.file.create_entity("IfcResourceConstraintRelationship", RelatedResourceObjects=[organisation])
|
||||
ifcopenshell.api.owner.remove_organisation(self.file, organisation=organisation)
|
||||
role = self.file.create_entity("IfcActorRole")
|
||||
self.file.create_entity("IfcResourceConstraintRelationship", RelatedResourceObjects=[role])
|
||||
ifcopenshell.api.owner.remove_role(self.file, role=role)
|
||||
assert len(self.file.by_type("IfcResourceConstraintRelationship")) == 0
|
||||
|
||||
def test_deleting_external_reference_relationships(self):
|
||||
organisation = self.file.create_entity("IfcOrganization")
|
||||
self.file.create_entity("IfcExternalReferenceRelationship", RelatedResourceObjects=[organisation])
|
||||
ifcopenshell.api.owner.remove_organisation(self.file, organisation=organisation)
|
||||
role = self.file.create_entity("IfcActorRole")
|
||||
self.file.create_entity("IfcExternalReferenceRelationship", RelatedResourceObjects=[role])
|
||||
ifcopenshell.api.owner.remove_role(self.file, role=role)
|
||||
assert len(self.file.by_type("IfcExternalReferenceRelationship")) == 0
|
||||
|
||||
Reference in New Issue
Block a user