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:
Andrej730
2024-04-09 16:06:21 +05:00
parent 24716a0089
commit d03f9237e2
7 changed files with 40 additions and 139 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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")