#1153 Drawings that are pure annotation now do not generate references

This commit is contained in:
Dion Moult
2022-04-17 12:29:34 +10:00
parent 538419a23f
commit c79eb60959
7 changed files with 43 additions and 11 deletions
+11 -2
View File
@@ -121,7 +121,7 @@ class TestOpenSheet:
class TestRemoveSheet:
def test_run(self, ifc, drawing):
ifc.run("document.remove_document", document="sheet").should_be_called()
ifc.run("document.remove_information", information="sheet").should_be_called()
drawing.import_sheets().should_be_called()
subject.remove_sheet(ifc, drawing, sheet="sheet")
@@ -162,7 +162,16 @@ class TestAddDrawing:
collector.assign("obj").should_be_called()
ifc.run("pset.add_pset", product="element", name="EPset_Drawing").should_be_called().will_return("pset")
ifc.run(
"pset.edit_pset", pset="pset", properties={"TargetView": "target_view", "Scale": "1/100"}
"pset.edit_pset",
pset="pset",
properties={
"TargetView": "target_view",
"Scale": "1/100",
"HumanScale": "1:100",
"HasUnderlay": False,
"HasLinework": True,
"HasAnnotation": True,
},
).should_be_called()
drawing.import_drawings().should_be_called()
subject.add_drawing(ifc, collector, drawing, target_view="target_view", location_hint="location_hint")
+4 -2
View File
@@ -28,6 +28,7 @@ class TestCopyClass:
def test_copy_with_new_geometry_derived_from_the_type(self, ifc, collector, root):
ifc.get_entity("obj").should_be_called().will_return("original_element")
root.get_object_representation("obj").should_be_called().will_return("representation")
ifc.run("root.copy_class", product="original_element").should_be_called().will_return("element")
ifc.link("element", "obj").should_be_called()
root.get_element_type("element").should_be_called().will_return("type")
@@ -41,12 +42,12 @@ class TestCopyClass:
def test_copy_with_new_geometry_added_afresh_for_speed(self, ifc, collector, geometry, root):
ifc.get_entity("obj").should_be_called().will_return("original_element")
root.get_object_representation("obj").should_be_called().will_return("representation")
ifc.run("root.copy_class", product="original_element").should_be_called().will_return("element")
ifc.link("element", "obj").should_be_called()
root.get_element_type("element").should_be_called().will_return("type")
root.does_type_have_representations("type").should_be_called().will_return(False)
root.get_object_representation("obj").should_be_called().will_return("representation")
root.get_representation_context("representation").should_be_called().will_return("context")
geometry.get_ifc_representation_class("element", "representation").should_be_called().will_return(
"ifc_representation_class"
@@ -64,17 +65,18 @@ class TestCopyClass:
def test_copy_with_no_new_geometry(self, ifc, collector, geometry, root):
ifc.get_entity("obj").should_be_called().will_return("original_element")
root.get_object_representation("obj").should_be_called().will_return(None)
ifc.run("root.copy_class", product="original_element").should_be_called().will_return("element")
ifc.link("element", "obj").should_be_called()
root.get_element_type("element").should_be_called().will_return("type")
root.does_type_have_representations("type").should_be_called().will_return(False)
root.get_object_representation("obj").should_be_called().will_return(None)
collector.assign("obj").should_be_called()
root.is_opening_element("element").should_be_called().will_return(False)
subject.copy_class(ifc, collector, geometry, root, obj="obj")
def test_copied_openings_have_dynamic_voids_added(self, ifc, collector, root):
ifc.get_entity("obj").should_be_called().will_return("original_element")
root.get_object_representation("obj").should_be_called().will_return(None)
ifc.run("root.copy_class", product="original_element").should_be_called().will_return("element")
ifc.link("element", "obj").should_be_called()
root.get_element_type("element").should_be_called().will_return("type")