ifc2x3 tests

This commit is contained in:
Andrej730
2024-05-10 11:33:33 +05:00
parent c50d1ea2fe
commit 1e630ede08
41 changed files with 315 additions and 94 deletions
@@ -36,3 +36,7 @@ class TestAssignProduct(test.bootstrap.IFC4):
ifcopenshell.api.run("sequence.assign_product", self.file, relating_product=wall, related_object=task)
ifcopenshell.api.run("sequence.assign_product", self.file, relating_product=wall, related_object=task)
assert wall.ReferencedBy[0].RelatedObjects == (task,)
class TestAssignProductIFC2X3(test.bootstrap.IFC2X3, TestAssignProduct):
pass
@@ -20,6 +20,8 @@ import test.bootstrap
import ifcopenshell.api
# NOTE: sequence module features relies on entities introduced in IFC4
# therefore no IFC2X3 tests
class TestCalculateTaskDuration(test.bootstrap.IFC4):
def test_calculating_the_duration_based_on_a_labour_resource_with_work_hours(self):
ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcProject")
@@ -22,6 +22,8 @@ import test.bootstrap
import ifcopenshell.api
# NOTE: sequence module features relies on entities introduced in IFC4
# therefore no IFC2X3 tests
class TestCascadeSchedule(test.bootstrap.IFC4):
def test_doing_nothing_if_the_task_has_no_successors(self):
task = ifcopenshell.api.run("sequence.add_task", self.file)
@@ -21,6 +21,9 @@ import test.bootstrap
import ifcopenshell.api
# NOTE: IfcTaskTime was introduced in IFC4
class TestEditTaskTime(test.bootstrap.IFC4):
def test_editing_all_attributes(self):
task_time = ifcopenshell.api.run("sequence.add_task_time", self.file, task=self.file.createIfcTask())
@@ -21,6 +21,7 @@ import test.bootstrap
import ifcopenshell.api
# NOTE: IfcWorkTime was introduced in IFC4
class TestEditWorkTime(test.bootstrap.IFC4):
def test_run(self):
work_time = self.file.createIfcWorkTime()
@@ -22,6 +22,8 @@ import test.bootstrap
import ifcopenshell.api
# NOTE: sequence module features relies on entities introduced in IFC4
# therefore no IFC2X3 tests
# A good way for checking these is to recreate them in ProjectLibre
class TestRecalculateSchedule(test.bootstrap.IFC4):
def test_doing_nothing_if_the_task_has_no_time(self):
@@ -27,3 +27,7 @@ class TestUnassignProduct(test.bootstrap.IFC4):
ifcopenshell.api.run("sequence.assign_product", self.file, relating_product=wall, related_object=task)
ifcopenshell.api.run("sequence.unassign_product", self.file, relating_product=wall, related_object=task)
assert len(self.file.by_type("IfcRelAssignsToProduct")) == 0
class TestUnassignProductIFC2X3(test.bootstrap.IFC2X3, TestUnassignProduct):
pass