mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 04:04:00 +00:00
nest.assign_object - support batching #4474
This commit is contained in:
@@ -29,7 +29,9 @@ def assign_object(ifc, nest, collector, relating_obj=None, related_obj=None):
|
||||
if not nest.can_nest(relating_obj, related_obj):
|
||||
return
|
||||
rel = ifc.run(
|
||||
"nest.assign_object", related_object=ifc.get_entity(related_obj), relating_object=ifc.get_entity(relating_obj)
|
||||
"nest.assign_object",
|
||||
related_objects=[ifc.get_entity(related_obj)],
|
||||
relating_object=ifc.get_entity(relating_obj),
|
||||
)
|
||||
collector.assign(relating_obj)
|
||||
collector.assign(related_obj)
|
||||
|
||||
@@ -38,7 +38,7 @@ class TestAssignObject:
|
||||
ifc.get_entity("relating_obj").should_be_called().will_return("relating_object")
|
||||
ifc.get_entity("related_obj").should_be_called().will_return("related_object")
|
||||
ifc.run(
|
||||
"nest.assign_object", related_object="related_object", relating_object="relating_object"
|
||||
"nest.assign_object", related_objects=["related_object"], relating_object="relating_object"
|
||||
).should_be_called().will_return("rel")
|
||||
nest.disable_editing("related_obj").should_be_called()
|
||||
collector.assign("relating_obj").should_be_called()
|
||||
|
||||
Reference in New Issue
Block a user