mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-30 00:23:14 +00:00
Drawings list now reads data from IFC, not Blender. See #1153.
This commit is contained in:
@@ -124,3 +124,16 @@ class TestRemoveSheet:
|
||||
ifc.run("document.remove_document", document="sheet").should_be_called()
|
||||
drawing.import_sheets().should_be_called()
|
||||
subject.remove_sheet(ifc, drawing, sheet="sheet")
|
||||
|
||||
|
||||
class TestLoadDrawings:
|
||||
def test_run(self, drawing):
|
||||
drawing.import_drawings().should_be_called()
|
||||
drawing.enable_editing_drawings().should_be_called()
|
||||
subject.load_drawings(drawing)
|
||||
|
||||
|
||||
class TestDisableEditingDrawings:
|
||||
def test_run(self, drawing):
|
||||
drawing.disable_editing_drawings().should_be_called()
|
||||
subject.disable_editing_drawings(drawing)
|
||||
|
||||
@@ -38,6 +38,13 @@ class TestCreateSvgSheet(NewFile):
|
||||
assert os.path.isfile(os.path.join(bpy.context.scene.BIMProperties.data_dir, "sheets", "X - FOOBAR.svg"))
|
||||
|
||||
|
||||
class TestDisableEditingDrawings(NewFile):
|
||||
def test_run(self):
|
||||
bpy.context.scene.DocProperties.is_editing_drawings = True
|
||||
subject.disable_editing_drawings()
|
||||
assert bpy.context.scene.DocProperties.is_editing_drawings == False
|
||||
|
||||
|
||||
class TestDisableEditingSheets(NewFile):
|
||||
def test_run(self):
|
||||
bpy.context.scene.DocProperties.is_editing_sheets = True
|
||||
@@ -61,6 +68,13 @@ class TestDisableEditingTextProduct(NewFile):
|
||||
assert obj.BIMTextProperties.is_editing_product == False
|
||||
|
||||
|
||||
class TestEnableEditingDrawings(NewFile):
|
||||
def test_run(self):
|
||||
bpy.context.scene.DocProperties.is_editing_drawings = False
|
||||
subject.enable_editing_drawings()
|
||||
assert bpy.context.scene.DocProperties.is_editing_drawings == True
|
||||
|
||||
|
||||
class TestEnableEditingSheets(NewFile):
|
||||
def test_run(self):
|
||||
bpy.context.scene.DocProperties.is_editing_sheets = False
|
||||
@@ -82,6 +96,17 @@ class TestEnableEditingTextProduct(NewFile):
|
||||
assert obj.BIMTextProperties.is_editing_product == True
|
||||
|
||||
|
||||
class TestEnsureUniqueDrawingName(NewFile):
|
||||
def test_run(self):
|
||||
ifc = ifcopenshell.file()
|
||||
tool.Ifc.set(ifc)
|
||||
assert subject.ensure_unique_drawing_name("FOOBAR") == "FOOBAR"
|
||||
ifc.createIfcAnnotation(Name="FOOBAR", ObjectType="DRAWING")
|
||||
assert subject.ensure_unique_drawing_name("FOOBAR") == "FOOBAR-X"
|
||||
ifc.createIfcAnnotation(Name="FOOBAR-X", ObjectType="DRAWING")
|
||||
assert subject.ensure_unique_drawing_name("FOOBAR") == "FOOBAR-X-X"
|
||||
|
||||
|
||||
class TestEnsureUniqueIdentification(NewFile):
|
||||
def test_run(self):
|
||||
ifc = ifcopenshell.file()
|
||||
@@ -158,6 +183,17 @@ class TestGetTextProduct(NewFile):
|
||||
assert subject.get_text_product(label) == wall
|
||||
|
||||
|
||||
class TestImportDrawings(NewFile):
|
||||
def test_run(self):
|
||||
ifc = ifcopenshell.file()
|
||||
tool.Ifc.set(ifc)
|
||||
drawing = ifc.createIfcAnnotation(Name="FOOBAR", ObjectType="DRAWING")
|
||||
subject.import_drawings()
|
||||
props = bpy.context.scene.DocProperties
|
||||
assert props.drawings[0].ifc_definition_id == drawing.id()
|
||||
assert props.drawings[0].name == "FOOBAR"
|
||||
|
||||
|
||||
class TestImportSheets(NewFile):
|
||||
def test_run(self):
|
||||
ifc = ifcopenshell.file()
|
||||
|
||||
Reference in New Issue
Block a user