This commit is contained in:
Andrej730
2025-02-19 11:06:03 +05:00
parent 6c511f6b1b
commit 67bac441ad
92 changed files with 1261 additions and 837 deletions
+11 -11
View File
@@ -244,25 +244,25 @@ class TestLoadProject(NewFile):
class TestLoadLinkedModels(NewFile):
def test_load_linked_models_no_document(self):
links = bpy.context.scene.BIMProjectProperties.links
props = tool.Project.get_project_props()
ifc = ifcopenshell.file()
tool.Ifc.set(ifc)
subject.load_linked_models_from_ifc()
assert len(links) == 0
assert len(props.links) == 0
def test_load_linked_models_document_no_references(self):
ifc = ifcopenshell.file()
links = bpy.context.scene.BIMProjectProperties.links
props = tool.Project.get_project_props()
ifcopenshell.api.root.create_entity(ifc, "IfcProject")
document = ifcopenshell.api.document.add_information(ifc)
document.Name = "BBIM_Linked_Models"
tool.Ifc.set(ifc)
subject.load_linked_models_from_ifc()
assert len(links) == 0
assert len(props.links) == 0
def test_load_linked_models_document_with_references(self):
ifc = ifcopenshell.file()
links = bpy.context.scene.BIMProjectProperties.links
props = tool.Project.get_project_props()
ifcopenshell.api.root.create_entity(ifc, "IfcProject")
document = ifcopenshell.api.document.add_information(ifc)
document.Name = "BBIM_Linked_Models"
@@ -271,8 +271,8 @@ class TestLoadLinkedModels(NewFile):
reference.Location = linked_model_path
tool.Ifc.set(ifc)
subject.load_linked_models_from_ifc()
assert len(links) == 1
assert links[0].name == linked_model_path
assert len(props.links) == 1
assert props.links[0].name == linked_model_path
class TestSaveLinkedModelsToIfc(NewFile):
@@ -286,8 +286,8 @@ class TestSaveLinkedModelsToIfc(NewFile):
def test_save_linked_models_to_ifc_paths_to_add(self):
ifc = ifcopenshell.file()
ifcopenshell.api.root.create_entity(ifc, "IfcProject")
links = bpy.context.scene.BIMProjectProperties.links
link = links.add()
props = tool.Project.get_project_props()
link = props.links.add()
linked_model_path = "test.ifc"
link.name = linked_model_path
tool.Ifc.set(ifc)
@@ -299,7 +299,7 @@ class TestSaveLinkedModelsToIfc(NewFile):
def test_save_linked_models_to_ifc_already_created_references(self):
ifc = ifcopenshell.file()
links = bpy.context.scene.BIMProjectProperties.links
links = tool.Project.get_project_props().links
ifcopenshell.api.root.create_entity(ifc, "IfcProject")
document = ifcopenshell.api.document.add_information(ifc)
@@ -326,7 +326,7 @@ class TestSaveLinkedModelsToIfc(NewFile):
def test_save_linked_models_to_ifc_references_to_remove(self):
ifc = ifcopenshell.file()
links = bpy.context.scene.BIMProjectProperties.links
links = tool.Project.get_project_props().links
ifcopenshell.api.root.create_entity(ifc, "IfcProject")
document = ifcopenshell.api.document.add_information(ifc)