mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 10:33:20 +00:00
Fix core test for drawing duplication (0b1c049)
This commit is contained in:
@@ -96,6 +96,7 @@ class Blender:
|
||||
def get_viewport_context(cls): pass
|
||||
def is_ifc_class_active(cls, ifc_class): pass
|
||||
def is_ifc_object(cls, obj): pass
|
||||
def remove_object(cls, obj): pass
|
||||
def set_active_object(cls, obj): pass
|
||||
def update_viewport(cls): pass
|
||||
|
||||
@@ -407,6 +408,7 @@ class Geometry:
|
||||
def delete_ifc_object(cls, obj): pass
|
||||
def delete_opening_object_placement(cls, opening): pass
|
||||
def does_representation_id_exist(cls, representation_id): pass
|
||||
def duplicate_ifc_objects(cls, objects_to_duplicate, active_object=None, duplicate_ifc_objects=None): pass
|
||||
def duplicate_object_data(cls, obj): pass
|
||||
def get_blender_offset_type(cls, obj): pass
|
||||
def get_cartesian_point_offset(cls, obj): pass
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import bonsai.core.drawing as subject
|
||||
from test.core.bootstrap import ifc, drawing, collector
|
||||
from test.core.bootstrap import ifc, drawing, collector, geometry, blender, Prophecy
|
||||
|
||||
|
||||
class TestEnableEditingText:
|
||||
@@ -396,7 +396,7 @@ class TestAddDrawing:
|
||||
|
||||
|
||||
class TestDuplicateDrawing:
|
||||
def test_run(self, ifc, drawing):
|
||||
def test_run(self, ifc: Prophecy, blender: Prophecy, drawing: Prophecy, geometry: Prophecy):
|
||||
drawing.get_name("drawing").should_be_called().will_return("name")
|
||||
drawing.ensure_unique_drawing_name("name").should_be_called().will_return("unique_name")
|
||||
ifc.run("root.copy_class", product="drawing").should_be_called().will_return("new_drawing")
|
||||
@@ -410,8 +410,13 @@ class TestDuplicateDrawing:
|
||||
).should_be_called()
|
||||
ifc.run("group.assign_group", group="new_group", products=["new_drawing"]).should_be_called()
|
||||
drawing.get_group_elements("group").should_be_called().will_return(["drawing", "annotation"])
|
||||
ifc.run("root.copy_class", product="annotation").should_be_called().will_return("new_annotation")
|
||||
drawing.copy_representation("annotation", "new_annotation").should_be_called()
|
||||
ifc.get_object("annotation").should_be_called().will_return("annotation_obj")
|
||||
geometry.duplicate_ifc_objects(["annotation_obj"]).should_be_called().will_return(
|
||||
({"annotation": ["new_annotation"]}, None)
|
||||
)
|
||||
ifc.get_object("new_annotation").should_be_called().will_return("new_annotation_obj")
|
||||
blender.remove_object("new_annotation_obj").should_be_called()
|
||||
|
||||
ifc.run("group.unassign_group", group="group", products=["new_annotation"]).should_be_called()
|
||||
ifc.run("group.assign_group", group="new_group", products=["new_annotation"]).should_be_called()
|
||||
|
||||
@@ -433,7 +438,7 @@ class TestDuplicateDrawing:
|
||||
ifc.run("document.assign_document", products=["new_drawing"], document="reference").should_be_called()
|
||||
|
||||
drawing.import_drawings().should_be_called()
|
||||
subject.duplicate_drawing(ifc, drawing, drawing="drawing", should_duplicate_annotations=True)
|
||||
subject.duplicate_drawing(ifc, blender, drawing, geometry, drawing="drawing", should_duplicate_annotations=True)
|
||||
|
||||
|
||||
class TestRemoveDrawing:
|
||||
|
||||
Reference in New Issue
Block a user