mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
Bonsai: update the core assign_type tests for should_map_representations
assign_type started passing should_map_representations to api type.assign_type, but the two core tests still predicted the old call. Prophecy serializes kwargs into the prediction key, so both failed with "Interface 'bonsai.core.tool.Ifc' was not called with run". Both cases use a plain string stand-in for the element, which has no material, so _is_per_instance_profile returns False and the flag is True. test/core is green again: 385 passed. Generated with the assistance of an AI coding tool. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,12 @@ from test.core.bootstrap import geometry, ifc, model, type
|
||||
class TestAssignType:
|
||||
def test_assigning_and_switching_to_an_existing_type_data(self, ifc, model, type):
|
||||
type.record_material_usage_attributes("element").should_be_called().will_return(None)
|
||||
ifc.run("type.assign_type", related_objects=["element"], relating_type="type").should_be_called()
|
||||
ifc.run(
|
||||
"type.assign_type",
|
||||
related_objects=["element"],
|
||||
relating_type="type",
|
||||
should_map_representations=True,
|
||||
).should_be_called()
|
||||
model.get_usage_type("type").should_be_called(2).will_return(None)
|
||||
ifc.get_object("type").should_be_called().will_return("type_obj")
|
||||
type.get_object_data("type_obj").should_be_called().will_return("type_obj_data")
|
||||
@@ -34,7 +39,12 @@ class TestAssignType:
|
||||
|
||||
def test_assigning_and_not_changing_data_if_the_type_has_no_data(self, ifc, model, type):
|
||||
type.record_material_usage_attributes("element").should_be_called().will_return(None)
|
||||
ifc.run("type.assign_type", related_objects=["element"], relating_type="type").should_be_called()
|
||||
ifc.run(
|
||||
"type.assign_type",
|
||||
related_objects=["element"],
|
||||
relating_type="type",
|
||||
should_map_representations=True,
|
||||
).should_be_called()
|
||||
model.get_usage_type("type").should_be_called(2).will_return(None)
|
||||
ifc.get_object("type").should_be_called().will_return("type_obj")
|
||||
type.get_object_data("type_obj").should_be_called().will_return(None)
|
||||
|
||||
Reference in New Issue
Block a user