mirror of https://github.com/papermerge/mglib
FileSystemStorage is cooler than Storage
parent
fd871c59d7
commit
d0af1087af
|
@ -60,3 +60,7 @@ class Storage:
|
||||||
return os.path.exists(
|
return os.path.exists(
|
||||||
self.path(_path)
|
self.path(_path)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class FileSystemStorage(Storage):
|
||||||
|
pass
|
||||||
|
|
|
@ -2,7 +2,7 @@ import os
|
||||||
import unittest
|
import unittest
|
||||||
from mglib.test.utils import TemporaryNode
|
from mglib.test.utils import TemporaryNode
|
||||||
from mglib.path import DocumentPath
|
from mglib.path import DocumentPath
|
||||||
from mglib.storage import Storage
|
from mglib.storage import FileSystemStorage
|
||||||
|
|
||||||
|
|
||||||
BASE_DIR = os.path.dirname(
|
BASE_DIR = os.path.dirname(
|
||||||
|
@ -16,7 +16,7 @@ MEDIA_ROOT = os.path.join(
|
||||||
class TestStorage(unittest.TestCase):
|
class TestStorage(unittest.TestCase):
|
||||||
|
|
||||||
def test_delete(self):
|
def test_delete(self):
|
||||||
storage = Storage(location=MEDIA_ROOT)
|
storage = FileSystemStorage(location=MEDIA_ROOT)
|
||||||
|
|
||||||
with TemporaryNode(MEDIA_ROOT) as media_root:
|
with TemporaryNode(MEDIA_ROOT) as media_root:
|
||||||
docs = media_root.add_folder("docs")
|
docs = media_root.add_folder("docs")
|
||||||
|
|
Loading…
Reference in New Issue