aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-06-11 19:17:44 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-06-11 19:17:44 -0500
commitd91b5a7c2d8f518a0654d066c41b1359bee1d04e (patch)
tree2b74c440d00aea7da46418a38652c6e98d5b20d1
parent2ecee34f08ad367f54f7a066a2e3ce81aba01f0f (diff)
downloadmediagoblin-d91b5a7c2d8f518a0654d066c41b1359bee1d04e.tar.lz
mediagoblin-d91b5a7c2d8f518a0654d066c41b1359bee1d04e.tar.xz
mediagoblin-d91b5a7c2d8f518a0654d066c41b1359bee1d04e.zip
Added a FakeRemoteStorage, for testing purposes
-rw-r--r--mediagoblin/tests/test_storage.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/mediagoblin/tests/test_storage.py b/mediagoblin/tests/test_storage.py
index 83f893f1..55b66e84 100644
--- a/mediagoblin/tests/test_storage.py
+++ b/mediagoblin/tests/test_storage.py
@@ -52,6 +52,11 @@ class FakeStorageSystem():
self.foobie = foobie
self.blech = blech
+class FakeRemoteStorage(storage.BasicFileStorage):
+ # Theoretically despite this, all the methods should work but it
+ # should force copying to the workbench
+ local_storage = False
+
def test_storage_system_from_paste_config():
this_storage = storage.storage_system_from_paste_config(
@@ -81,9 +86,12 @@ def test_storage_system_from_paste_config():
# Basic file storage tests
##########################
-def get_tmp_filestorage(mount_url=None):
+def get_tmp_filestorage(mount_url=None, fake_remote=False):
tmpdir = tempfile.mkdtemp()
- this_storage = storage.BasicFileStorage(tmpdir, mount_url)
+ if fake_remote:
+ this_storage = FakeRemoteStorage(tmpdir, mount_url)
+ else:
+ this_storage = storage.BasicFileStorage(tmpdir, mount_url)
return tmpdir, this_storage