Fix bug where editing then switching to the current representation crashes.

This commit is contained in:
Dion Moult
2022-01-30 14:46:05 +11:00
parent c7428dd160
commit e9670a6906
6 changed files with 74 additions and 25 deletions
+16
View File
@@ -121,6 +121,15 @@ class TestDoesObjectHaveMeshWithFaces(NewFile):
assert subject.does_object_have_mesh_with_faces(obj) is True
class TestDoesRepresentationIdExist(NewFile):
def test_run(self):
ifc = ifcopenshell.file()
tool.Ifc.set(ifc)
representation = ifc.createIfcShapeRepresentation()
assert subject.does_representation_id_exist(representation.id()) is True
assert subject.does_representation_id_exist(12345) is False
class TestDuplicateObjectData(NewFile):
def test_run(self):
data = bpy.data.meshes.new("Mesh")
@@ -160,6 +169,13 @@ class TestGetRepresentationData(NewFile):
assert subject.get_representation_data(representation) == data
class TestGetRepresentationId(NewFile):
def test_run(self):
ifc = ifcopenshell.file()
representation = ifc.createIfcShapeRepresentation()
assert subject.get_representation_id(representation) == representation.id()
class TestGetRepresentationName(NewFile):
def test_run(self):
ifc = ifcopenshell.file()