mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-06 12:26:26 +00:00
Annotations are now auto collected correctly and simpler drawings UI. See #1153.
This commit is contained in:
@@ -198,3 +198,31 @@ class TestUpdateDrawingName:
|
||||
drawing.get_drawing_collection("drawing").should_be_called().will_return("collection")
|
||||
drawing.set_drawing_collection_name("group", "collection").should_be_called()
|
||||
subject.update_drawing_name(ifc, drawing, drawing="drawing", name="name")
|
||||
|
||||
|
||||
class TestAddAnnotation:
|
||||
def test_run(self, ifc, collector, drawing):
|
||||
drawing.show_decorations().should_be_called()
|
||||
drawing.get_drawing_target_view("drawing").should_be_called().will_return("target_view")
|
||||
drawing.get_annotation_context("target_view").should_be_called().will_return("context")
|
||||
drawing.create_annotation_object("object_type").should_be_called().will_return("obj")
|
||||
ifc.get_entity("obj").should_be_called().will_return(None)
|
||||
drawing.get_ifc_representation_class("object_type").should_be_called().will_return("ifc_representation_class")
|
||||
drawing.run_root_assign_class(
|
||||
obj="obj",
|
||||
ifc_class="IfcAnnotation",
|
||||
predefined_type="object_type",
|
||||
should_add_representation=True,
|
||||
context="context",
|
||||
ifc_representation_class="ifc_representation_class",
|
||||
).should_be_called().will_return("element")
|
||||
drawing.get_drawing_group("drawing").should_be_called().will_return("group")
|
||||
ifc.run("group.assign_group", group="group", product="element").should_be_called()
|
||||
collector.assign("obj").should_be_called()
|
||||
drawing.enable_editing("obj").should_be_called()
|
||||
subject.add_annotation(ifc, collector, drawing, drawing="drawing", object_type="object_type")
|
||||
|
||||
def test_do_not_add_without_an_annotation_context(self, ifc, collector, drawing):
|
||||
drawing.get_drawing_target_view("drawing").should_be_called().will_return("target_view")
|
||||
drawing.get_annotation_context("target_view").should_be_called().will_return(None)
|
||||
subject.add_annotation(ifc, collector, drawing, drawing="drawing", object_type="object_type")
|
||||
|
||||
Reference in New Issue
Block a user