Run black on IOS-Python

This commit is contained in:
Dion Moult
2024-07-26 12:00:28 +10:00
parent d51fa2c5f7
commit a6286293d8
83 changed files with 603 additions and 637 deletions
@@ -27,24 +27,18 @@ class TestAssignControl(test.bootstrap.IFC4):
control = ifcopenshell.api.cost.add_cost_schedule(self.file)
# simple assignment
relation = ifcopenshell.api.control.assign_control(
self.file, relating_control=control, related_object=wall
)
relation = ifcopenshell.api.control.assign_control(self.file, relating_control=control, related_object=wall)
assert len(self.file.by_type("IfcRelAssignsToControl")) == 1
assert relation.RelatingControl == control
assert relation.RelatedObjects == (wall,)
# trying to establish existing relationship
relation = ifcopenshell.api.control.assign_control(
self.file, relating_control=control, related_object=wall
)
relation = ifcopenshell.api.control.assign_control(self.file, relating_control=control, related_object=wall)
assert relation is None
# assigning same control to another object
wall1 = self.file.createIfcWall()
relation = ifcopenshell.api.control.assign_control(
self.file, relating_control=control, related_object=wall1
)
relation = ifcopenshell.api.control.assign_control(self.file, relating_control=control, related_object=wall1)
assert relation is not None
assert len(self.file.by_type("IfcRelAssignsToControl")) == 1
assert relation.RelatingControl == control
@@ -27,17 +27,13 @@ class TestUnassignControl(test.bootstrap.IFC4):
control = ifcopenshell.api.cost.add_cost_schedule(self.file)
# assign and unassign
relation = ifcopenshell.api.control.assign_control(
self.file, relating_control=control, related_object=wall
)
relation = ifcopenshell.api.control.assign_control(self.file, relating_control=control, related_object=wall)
ifcopenshell.api.control.unassign_control(self.file, relating_control=control, related_object=wall)
assert len(self.file.by_type("IfcRelAssignsToControl")) == 0
# 1 control 2 related objects
wall1 = self.file.createIfcWall()
relation = ifcopenshell.api.control.assign_control(
self.file, relating_control=control, related_object=wall
)
relation = ifcopenshell.api.control.assign_control(self.file, relating_control=control, related_object=wall)
ifcopenshell.api.control.assign_control(self.file, relating_control=control, related_object=wall1)
ifcopenshell.api.control.unassign_control(self.file, relating_control=control, related_object=wall1)
assert len(self.file.by_type("IfcRelAssignsToControl")) == 1