mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Fix type assign_type core test (44a52863a)
This commit is contained in:
@@ -624,7 +624,10 @@ class Model:
|
||||
def import_rectangle(cls, obj, position, profile): pass
|
||||
def load_openings(cls, openings): pass
|
||||
def purge_scene_openings(cls): pass
|
||||
def recalculate_walls(cls, objs): pass
|
||||
def regenerate_array(cls, parent, data): pass
|
||||
def regenerate_profile(cls, obj): pass
|
||||
def regenerate_slab(cls, obj): pass
|
||||
def reload_body_representation(cls, obj_or_objects): pass
|
||||
def replace_object_ifc_representation(cls, ifc_file, ifc_context, obj, new_representation): pass
|
||||
|
||||
@@ -1123,6 +1126,8 @@ class Type:
|
||||
def get_representation_context(cls, representation): pass
|
||||
def get_type_occurrences(cls, element_type): pass
|
||||
def has_material_usage(cls, element): pass
|
||||
def record_material_usage_attributes(cls, element): pass
|
||||
def restore_material_usage_attributes(cls, element, usage_attributes): pass
|
||||
def run_geometry_add_representation(cls, obj=None, context=None, ifc_representation_class=None, profile_set_usage=None): pass
|
||||
def run_geometry_switch_representation(cls, obj=None, representation=None): pass
|
||||
|
||||
|
||||
@@ -22,8 +22,9 @@ 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()
|
||||
type.has_material_usage("element").should_be_called().will_return(False)
|
||||
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")
|
||||
type.change_object_data("obj", "type_obj_data", is_global=False).should_be_called()
|
||||
@@ -31,9 +32,10 @@ class TestAssignType:
|
||||
type.disable_editing("obj").should_be_called()
|
||||
subject.assign_type(ifc, model, type, element="element", type="type")
|
||||
|
||||
def test_assigning_and_not_changing_data_if_the_type_has_no_data(self, ifc, type):
|
||||
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()
|
||||
type.has_material_usage("element").should_be_called().will_return(False)
|
||||
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)
|
||||
ifc.get_object("element").should_be_called().will_return("obj")
|
||||
|
||||
Reference in New Issue
Block a user