From 4d3ed819716ba845f64e03eb2fcf0e18422456ff Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 21 Jun 2023 12:52:55 +0500 Subject: [PATCH] Fixed test after b035129 --- src/blenderbim/test/bim/feature/material.feature | 9 +++++++-- src/blenderbim/test/bim/test_feature.py | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/test/bim/feature/material.feature b/src/blenderbim/test/bim/feature/material.feature index 87ce5b82d6..18d9b8b0bc 100644 --- a/src/blenderbim/test/bim/feature/material.feature +++ b/src/blenderbim/test/bim/feature/material.feature @@ -156,26 +156,31 @@ Scenario: Unassign material - material layer set When I press "bim.unassign_material" Then nothing happens -Scenario: Unassign material - material layer set usages will not be removed +Scenario: Unassign material - removing inherited material Given an empty IFC project And I add a cube And the object "Cube" is selected And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" And I press "bim.assign_class" + And I add an empty And the object "Empty" is selected And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType" And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType" And I press "bim.assign_class" + And I press "bim.add_material(obj='')" And I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet" And I press "bim.assign_material" + And the object "IfcWall/Cube" is selected When the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()" And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')" + Then the object "IfcWall/Cube" has a "100" thick layered material containing the material "Default" + When I press "bim.unassign_material" - Then the object "IfcWall/Cube" has a "100" thick layered material containing the material "Default" + Then the object "IfcWall/Cube" has no IFC materials Scenario: Enable editing assigned material - material layer set Given an empty IFC project diff --git a/src/blenderbim/test/bim/test_feature.py b/src/blenderbim/test/bim/test_feature.py index 5cbdf39897..816c762c28 100644 --- a/src/blenderbim/test/bim/test_feature.py +++ b/src/blenderbim/test/bim/test_feature.py @@ -600,6 +600,12 @@ def the_object_name_has_a_thickness_thick_layered_material_containing_the_materi assert is_x(total_thickness, float(thickness)) assert material_name in material_names +@then(parsers.parse('the object "{name}" has no IFC materials')) +def the_object_has_no_ifc_materials(name): + element = tool.Ifc.get_entity(the_object_name_exists(name)) + material = ifcopenshell.util.element.get_material(element) + assert material is None + @then( parsers.parse(