aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-06-11 11:18:03 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-06-11 11:18:03 -0500
commit3a89c23e7fd330ea662dd57ff74a9d424d476b84 (patch)
tree8852cdfedcbc05628e8f7046b3aa1dde88774607 /mediagoblin/tests
parentd07713d0b0696528927e720e957ac4d049e3f46f (diff)
downloadmediagoblin-3a89c23e7fd330ea662dd57ff74a9d424d476b84.tar.lz
mediagoblin-3a89c23e7fd330ea662dd57ff74a9d424d476b84.tar.xz
mediagoblin-3a89c23e7fd330ea662dd57ff74a9d424d476b84.zip
Allow storage systems to be local and allow for a get_local_path
method if applicable.
Diffstat (limited to 'mediagoblin/tests')
-rw-r--r--mediagoblin/tests/test_storage.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/mediagoblin/tests/test_storage.py b/mediagoblin/tests/test_storage.py
index 61dd5dca..5efed405 100644
--- a/mediagoblin/tests/test_storage.py
+++ b/mediagoblin/tests/test_storage.py
@@ -214,3 +214,20 @@ def test_basic_storage_url_for_file():
['dir1', 'dir2', 'filename.txt'])
expected = 'http://media.example.org/ourmedia/dir1/dir2/filename.txt'
assert result == expected
+
+
+def test_basic_storage_get_local_path():
+ tmpdir, this_storage = get_tmp_filestorage()
+
+ result = this_storage.get_local_path(
+ ['dir1', 'dir2', 'filename.txt'])
+
+ expected = os.path.join(
+ tmpdir, 'dir1/dir2/filename.txt')
+
+ assert result == expected
+
+
+def test_basic_storage_is_local():
+ tmpdir, this_storage = get_tmp_filestorage()
+ assert this_storage.local_storage is True