mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-07 04:46:25 +00:00
Fix #2274. You can now purge unused types.
This commit is contained in:
@@ -114,6 +114,14 @@ class TestGetIfcRepresentationClass(NewFile):
|
||||
assert subject.get_ifc_representation_class(ifc.createIfcColumn()) is None
|
||||
|
||||
|
||||
class TestGetModelTypes(NewFile):
|
||||
def test_run(self):
|
||||
ifc = ifcopenshell.file()
|
||||
tool.Ifc.set(ifc)
|
||||
wall_type = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcWallType")
|
||||
assert subject.get_model_types() == [wall_type]
|
||||
|
||||
|
||||
class TestGetObjectData(NewFile):
|
||||
def test_run(self):
|
||||
data = bpy.data.meshes.new("Mesh")
|
||||
@@ -139,6 +147,16 @@ class TestGetRepresentationContext(NewFile):
|
||||
assert subject.get_representation_context(representation) == context
|
||||
|
||||
|
||||
class TestGetTypeOccurrences(NewFile):
|
||||
def test_run(self):
|
||||
ifc = ifcopenshell.file()
|
||||
tool.Ifc.set(ifc)
|
||||
wall_type = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcWallType")
|
||||
wall = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcWall")
|
||||
ifcopenshell.api.run("type.assign_type", ifc, related_object=wall, relating_type=wall_type)
|
||||
assert subject.get_type_occurrences(wall_type) == (wall,)
|
||||
|
||||
|
||||
class TestHasMaterialUsage(NewFile):
|
||||
def test_getting_a_profile_set_usage(self):
|
||||
ifc = ifcopenshell.file()
|
||||
@@ -149,6 +167,13 @@ class TestHasMaterialUsage(NewFile):
|
||||
assert subject.has_material_usage(element) is True
|
||||
|
||||
|
||||
class TestRemoveObject(NewFile):
|
||||
def test_run(self):
|
||||
obj = bpy.data.objects.new("Object", None)
|
||||
subject.remove_object(obj)
|
||||
assert not bpy.data.objects.get("Object")
|
||||
|
||||
|
||||
class TestRunGeometryAddRepresentation(NewFile):
|
||||
def test_nothing(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user