mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Fix left out invalid mesh data blocks and fix failing geom core test (after fcee54c)
This commit is contained in:
@@ -102,8 +102,10 @@ Scenario: Remove representation - remove an active representation
|
||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
|
||||
And I press "bim.assign_class"
|
||||
When the variable "representation_body" is "{ifc}.by_type('IfcShapeRepresentation')[0].id()"
|
||||
And the variable "representation_context" is "{ifc}.by_type('IfcShapeRepresentation')[0].ContextOfItems.id()"
|
||||
And I press "bim.remove_representation(representation_id={representation_body})"
|
||||
Then the object "IfcWall/Cube" has no data
|
||||
And the mesh "{representation_context}/{representation_body}" does not exist
|
||||
|
||||
Scenario: Remove representation - remove an unloaded representation
|
||||
Given an empty IFC project
|
||||
|
||||
@@ -1194,6 +1194,11 @@ def the_material_name_does_not_exist(name):
|
||||
assert bpy.data.materials.get(name) is None, "Material exists"
|
||||
|
||||
|
||||
@then(parsers.parse('the mesh "{name}" does not exist'))
|
||||
def the_mesh_name_does_not_exist(name: str) -> None:
|
||||
assert bpy.data.meshes.get(name) is None, f"Mesh '{name}' exists"
|
||||
|
||||
|
||||
def get_ifc_material_by_name(name: str) -> Union[ifcopenshell.entity_instance, None]:
|
||||
ifc_file = tool.Ifc.get()
|
||||
material = next((m for m in ifc_file.by_type("IfcMaterial") if m.Name == name), None)
|
||||
|
||||
@@ -231,7 +231,6 @@ class TestRemoveRepresentation:
|
||||
geometry.switch_from_representation("type_obj", "representation").should_be_called()
|
||||
ifc.run("geometry.unassign_representation", product="type", representation="representation").should_be_called()
|
||||
ifc.run("geometry.remove_representation", representation="representation").should_be_called()
|
||||
geometry.delete_data("data").should_be_called()
|
||||
subject.remove_representation(ifc, geometry, obj="obj", representation="mapped_rep")
|
||||
|
||||
def test_removing_an_unused_mapped_representation(self, ifc, geometry):
|
||||
@@ -254,7 +253,6 @@ class TestRemoveRepresentation:
|
||||
"geometry.unassign_representation", product="element", representation="representation"
|
||||
).should_be_called()
|
||||
ifc.run("geometry.remove_representation", representation="representation").should_be_called()
|
||||
geometry.delete_data("data").should_be_called()
|
||||
subject.remove_representation(ifc, geometry, obj="obj", representation="representation")
|
||||
|
||||
def test_removing_an_actively_used_representation(self, ifc, geometry):
|
||||
@@ -269,7 +267,6 @@ class TestRemoveRepresentation:
|
||||
"geometry.unassign_representation", product="element", representation="representation"
|
||||
).should_be_called()
|
||||
ifc.run("geometry.remove_representation", representation="representation").should_be_called()
|
||||
geometry.delete_data("data").should_be_called()
|
||||
subject.remove_representation(ifc, geometry, obj="obj", representation="representation")
|
||||
|
||||
def test_removing_an_unused_representation(self, ifc, geometry):
|
||||
|
||||
Reference in New Issue
Block a user