mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-06 12:26:26 +00:00
Fix #2274. You can now purge unused types.
This commit is contained in:
@@ -124,6 +124,5 @@ class TestSelectSimilarContainer:
|
||||
ifc.get_entity("obj").should_be_called().will_return("element")
|
||||
spatial.get_container("element").should_be_called().will_return("container")
|
||||
spatial.get_decomposed_elements("container").should_be_called().will_return(["contained_element"])
|
||||
ifc.get_object("contained_element").should_be_called().will_return("contained_obj")
|
||||
spatial.select_object("contained_obj").should_be_called()
|
||||
spatial.select_products(["contained_element"]).should_be_called()
|
||||
subject.select_similar_container(ifc, spatial, obj="obj")
|
||||
|
||||
@@ -39,3 +39,14 @@ class TestAssignType:
|
||||
ifc.get_object("element").should_be_called().will_return("obj")
|
||||
type.disable_editing("obj").should_be_called()
|
||||
subject.assign_type(ifc, type, element="element", type="type")
|
||||
|
||||
|
||||
class TestPurgeUnusedTypes:
|
||||
def test_run(self, ifc, type):
|
||||
type.get_model_types().should_be_called().will_return(["element_type"])
|
||||
type.get_type_occurrences("element_type").should_be_called().will_return([])
|
||||
ifc.run("root.remove_product", product="element_type").should_be_called()
|
||||
ifc.get_object("element_type").should_be_called().will_return("obj")
|
||||
ifc.unlink(obj="obj").should_be_called()
|
||||
type.remove_object("obj").should_be_called()
|
||||
subject.purge_unused_types(ifc, type)
|
||||
|
||||
Reference in New Issue
Block a user