mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +00:00
fix create sheet test failing if bonsai and tests are on different disks
It was failing on Windows with something like "ValueError: path is on mount 'L:', start on mount 'C:'". I guess it doesn't really occur in bonsai as sheets are typically stored next to the titleblocks (we used to use absolute paths awhile ago and now everything is relative to the ifc project)
This commit is contained in:
@@ -69,11 +69,13 @@ class TestCreateSvgSheet(NewFile):
|
||||
ifc = ifcopenshell.file()
|
||||
ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcProject")
|
||||
tool.Ifc.set(ifc)
|
||||
ifc_path = Path("test/files/temp/test.ifc").absolute()
|
||||
bpy.ops.bim.save_project(filepath=str(ifc_path), should_save_as=True)
|
||||
document = ifc.createIfcDocumentInformation(
|
||||
Identification="X",
|
||||
Name="FOOBAR",
|
||||
Scope="DOCUMENTATION",
|
||||
Location=os.path.join(bpy.context.scene.BIMProperties.data_dir, "cache", "X - FOOBAR.svg"),
|
||||
Scope="SHEET",
|
||||
Location=(ifc_path.parent / "layouts" / "X - FOOBAR.svg").as_posix(),
|
||||
)
|
||||
uri = subject.create_svg_sheet(document, "A1")
|
||||
assert uri.endswith(".svg")
|
||||
|
||||
Reference in New Issue
Block a user