mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 03:33:48 +00:00
library.assign_reference - support batching #4474
This commit is contained in:
@@ -124,21 +124,21 @@ class TestAssignBrickReference:
|
||||
ifc.run("library.add_reference", library="library").should_be_called().will_return("reference")
|
||||
brick.export_brick_attributes("brick_uri").should_be_called().will_return("attributes")
|
||||
ifc.run("library.edit_reference", reference="reference", attributes="attributes").should_be_called()
|
||||
ifc.run("library.assign_reference", product="element", reference="reference").should_be_called()
|
||||
ifc.run("library.assign_reference", products=["element"], reference="reference").should_be_called()
|
||||
brick.get_brickifc_project().should_be_called().will_return("project")
|
||||
brick.add_brickifc_reference("brick_uri", "element", "project").should_be_called()
|
||||
subject.assign_brick_reference(ifc, brick, element="element", library="library", brick_uri="brick_uri")
|
||||
|
||||
def test_assigning_to_an_existing_reference(self, ifc, brick):
|
||||
brick.get_library_brick_reference("library", "brick_uri").should_be_called().will_return("reference")
|
||||
ifc.run("library.assign_reference", product="element", reference="reference").should_be_called()
|
||||
ifc.run("library.assign_reference", products=["element"], reference="reference").should_be_called()
|
||||
brick.get_brickifc_project().should_be_called().will_return("project")
|
||||
brick.add_brickifc_reference("brick_uri", "element", "project").should_be_called()
|
||||
subject.assign_brick_reference(ifc, brick, element="element", library="library", brick_uri="brick_uri")
|
||||
|
||||
def test_adding_a_brickifc_project_if_it_doesnt_exist(self, ifc, brick):
|
||||
brick.get_library_brick_reference("library", "brick_uri").should_be_called().will_return("reference")
|
||||
ifc.run("library.assign_reference", product="element", reference="reference").should_be_called()
|
||||
ifc.run("library.assign_reference", products=["element"], reference="reference").should_be_called()
|
||||
brick.get_brickifc_project().should_be_called().will_return(None)
|
||||
brick.get_namespace("brick_uri").should_be_called().will_return("namespace")
|
||||
brick.add_brickifc_project("namespace").should_be_called().will_return("project")
|
||||
@@ -277,4 +277,4 @@ class TestSetBrickListRoot:
|
||||
class TestRemoveBrickRelation:
|
||||
def test_run(self, brick):
|
||||
brick.remove_relation("brick_uri", "predicate", "object").should_be_called()
|
||||
subject.remove_brick_relation(brick, brick_uri="brick_uri", predicate="predicate", object="object")
|
||||
subject.remove_brick_relation(brick, brick_uri="brick_uri", predicate="predicate", object="object")
|
||||
|
||||
@@ -114,7 +114,7 @@ class TestEditLibraryReference:
|
||||
class TestAssignLibraryReference:
|
||||
def test_run(self, ifc):
|
||||
ifc.get_entity("obj").should_be_called().will_return("product")
|
||||
ifc.run("library.assign_reference", product="product", reference="reference").should_be_called()
|
||||
ifc.run("library.assign_reference", products=["product"], reference="reference").should_be_called()
|
||||
subject.assign_library_reference(ifc, obj="obj", reference="reference")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user