diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-04-16 11:03:32 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-04-16 11:03:32 -0500 |
commit | d024806a0b3c027a19b0b0462a7633c457c01f8a (patch) | |
tree | ac38d8af740d3721d8e0fd20dcf670dce508b692 | |
parent | d2be0838a7492a8fe7eeeb19257735e235e9fe26 (diff) | |
download | mediagoblin-d024806a0b3c027a19b0b0462a7633c457c01f8a.tar.lz mediagoblin-d024806a0b3c027a19b0b0462a7633c457c01f8a.tar.xz mediagoblin-d024806a0b3c027a19b0b0462a7633c457c01f8a.zip |
Tests for BasicFileStorage.delete_file()
-rw-r--r-- | mediagoblin/tests/test_storage.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/mediagoblin/tests/test_storage.py b/mediagoblin/tests/test_storage.py index 38c820bf..6a73cd82 100644 --- a/mediagoblin/tests/test_storage.py +++ b/mediagoblin/tests/test_storage.py @@ -140,7 +140,22 @@ def test_basic_storage_get_file(): def test_basic_storage_delete_file(): - pass + tmpdir, this_storage = get_tmp_filestorage() + + assert not os.path.exists( + os.path.join(tmpdir, 'dir1/dir2/ourfile.txt')) + + filepath = ['dir1', 'dir2', 'ourfile.txt'] + with this_storage.get_file(filepath, 'w') as our_file: + our_file.write('Testing this file') + + assert os.path.exists( + os.path.join(tmpdir, 'dir1/dir2/ourfile.txt')) + + this_storage.delete_file(filepath) + + assert not os.path.exists( + os.path.join(tmpdir, 'dir1/dir2/ourfile.txt')) def test_basic_storage_url_for_file(): |