diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-04-10 16:23:55 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-04-10 16:23:55 -0500 |
commit | 92fb87ae8d3260c3a5da45aa7b0c75e401e81791 (patch) | |
tree | 77e367762ae3fc49791da578a703aa5fb283ddc3 | |
parent | 17e7093e4b63a9df1ff717de839c6281dbf55e98 (diff) | |
download | mediagoblin-92fb87ae8d3260c3a5da45aa7b0c75e401e81791.tar.lz mediagoblin-92fb87ae8d3260c3a5da45aa7b0c75e401e81791.tar.xz mediagoblin-92fb87ae8d3260c3a5da45aa7b0c75e401e81791.zip |
Unit tests for BasicFileStorage.file_exists()
-rw-r--r-- | mediagoblin/tests/test_storage.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mediagoblin/tests/test_storage.py b/mediagoblin/tests/test_storage.py index a30ca149..ff49ec9b 100644 --- a/mediagoblin/tests/test_storage.py +++ b/mediagoblin/tests/test_storage.py @@ -70,6 +70,19 @@ def test_basic_storage__resolve_filepath(): def test_basic_storage_file_exists(): + tmpdir, this_storage = get_tmp_filestorage() + + os.makedirs(os.path.join(tmpdir, 'dir1', 'dir2')) + filename = os.path.join(tmpdir, 'dir1', 'dir2', 'filename.txt') + with open(filename, 'w') as ourfile: + ourfile.write("I'm having a lovely day!") + + assert this_storage.file_exists(['dir1', 'dir2', 'filename.txt']) + assert not this_storage.file_exists(['dir1', 'dir2', 'thisfile.lol']) + assert not this_storage.file_exists(['dnedir1', 'dnedir2', 'somefile.lol']) + + +def test_basic_storage_get_unique_filename(): pass |