mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 04:04:00 +00:00
deprecate spatial.remove_container in favor of spatial.assign_container
added temporary support for old version with warnings: WARNING. `spatial.remove_container` api method is deprecated and should be replaced with spatial.unassign_container WARNING. `product` argument is deprecated for API method "spatial.remove_container" and should be replaced with `products`.
This commit is contained in:
@@ -78,7 +78,7 @@ def change_spatial_level(spatial, parent=None):
|
||||
|
||||
|
||||
def remove_container(ifc, collector, obj=None):
|
||||
ifc.run("spatial.remove_container", product=ifc.get_entity(obj))
|
||||
ifc.run("spatial.unassign_container", products=[ifc.get_entity(obj)])
|
||||
collector.assign(obj)
|
||||
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class TestChangeSpatialLevel:
|
||||
class TestRemoveContainer:
|
||||
def test_run(self, ifc, collector):
|
||||
ifc.get_entity("obj").should_be_called().will_return("element")
|
||||
ifc.run("spatial.remove_container", product="element").should_be_called()
|
||||
ifc.run("spatial.unassign_container", products=["element"]).should_be_called()
|
||||
collector.assign("obj").should_be_called()
|
||||
subject.remove_container(ifc, collector, obj="obj")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user