Allow storage systems to be local and allow for a get_local_path

method if applicable.
This commit is contained in:
Christopher Allan Webber
2011-06-11 11:18:03 -05:00
parent d07713d0b0
commit 3a89c23e7f
2 changed files with 37 additions and 1 deletions

View File

@@ -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