MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / test_changed_geometry

Method test_changed_geometry

src/ifcdiff/test.py:80–96  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

78 assert ifc_diff.change_register == {wall.GlobalId: {"attributes_changed": True}}
79
80 def test_changed_geometry(self):
81 ifc_file = setup_project()
82 wall = ifcopenshell.api.root.create_entity(ifc_file, ifc_class="IfcWall", name="Foo")
83 context = ifcopenshell.util.representation.get_context(ifc_file, "Model", "Body", "MODEL_VIEW")
84 assert context
85 representation = ifcopenshell.api.geometry.add_slab_representation(ifc_file, context, depth=0.2)
86 ifcopenshell.api.geometry.assign_representation(ifc_file, wall, representation)
87
88 new_file = ifc_file.from_string(ifc_file.to_string())
89 extrusion = new_file.by_type("IfcExtrudedAreaSolid")[0]
90 extrusion.Depth = 500.0
91
92 ifc_diff = ifcdiff.IfcDiff(ifc_file, new_file, relationships=["geometry"])
93 ifc_diff.diff()
94 assert ifc_diff.added_elements == set()
95 assert ifc_diff.deleted_elements == set()
96 assert ifc_diff.change_register == {wall.GlobalId: {"geometry_changed": True}}

Callers

nothing calls this directly

Calls 8

diffMethod · 0.95
from_stringMethod · 0.80
setup_projectFunction · 0.70
setFunction · 0.50
create_entityMethod · 0.45
get_contextMethod · 0.45
to_stringMethod · 0.45
by_typeMethod · 0.45

Tested by

no test coverage detected