MacOS: fix path quirk in filemanager unit tests.
On MacOS, `tempfile.mkdtemp()` doesn't necessarily return a canonical path (it uses `/private/var` instead of `/var`, but they are the same thing). Since the `filemanager.storage` module canonicalizes paths, tests were erroneously failing due to prefix match failures.
This commit is contained in:
parent
d773b9d486
commit
810765ddc9
1 changed files with 2 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms
|
|||
import unittest
|
||||
import os
|
||||
import mock
|
||||
import os.path
|
||||
|
||||
from ddt import ddt, unpack, data
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ class LocalStorageTest(unittest.TestCase):
|
|||
|
||||
def setUp(self):
|
||||
import tempfile
|
||||
self.basefolder = tempfile.mkdtemp()
|
||||
self.basefolder = os.path.realpath(os.path.abspath(tempfile.mkdtemp()))
|
||||
self.storage = octoprint.filemanager.storage.LocalFileStorage(self.basefolder)
|
||||
|
||||
# mock file manager module
|
||||
|
|
|
|||
Loading…
Reference in a new issue