diff options
author | drebs <drebs@leap.se> | 2017-12-06 20:37:55 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2017-12-13 13:43:48 -0200 |
commit | 06ade52b27800ca94c1abf73964975a5bf717f04 (patch) | |
tree | 2812872f13eff5f2463c6ca8e39208097f503304 /tests/blobs | |
parent | 8f94f9c2d93046e0f67cffd7974f7d28393bbf86 (diff) |
[refactor] make blobs backend delete_blob() agnostic of twisted.web requests
Diffstat (limited to 'tests/blobs')
-rw-r--r-- | tests/blobs/test_fs_backend.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/blobs/test_fs_backend.py b/tests/blobs/test_fs_backend.py index 5a136f00..4dbee595 100644 --- a/tests/blobs/test_fs_backend.py +++ b/tests/blobs/test_fs_backend.py @@ -172,14 +172,13 @@ class FilesystemBackendTestCase(unittest.TestCase): @mock.patch('leap.soledad.server._blobs.os.unlink') def test_delete_blob(self, unlink_mock): backend = _blobs.FilesystemBlobsBackend(blobs_path=self.tempdir) - request = DummyRequest(['']) # write a blob... path = backend._get_path('user', 'blob_id', '') mkdir_p(os.path.split(path)[0]) with open(path, "w") as f: f.write("bl0b") # ...and delete it - backend.delete_blob('user', 'blob_id', request) + backend.delete_blob('user', 'blob_id') unlink_mock.assert_any_call(backend._get_path('user', 'blob_id')) unlink_mock.assert_any_call(backend._get_path('user', @@ -189,14 +188,13 @@ class FilesystemBackendTestCase(unittest.TestCase): @mock.patch('leap.soledad.server._blobs.os.unlink') def test_delete_blob_custom_namespace(self, unlink_mock): backend = _blobs.FilesystemBlobsBackend(blobs_path=self.tempdir) - request = DummyRequest(['']) # write a blob... path = backend._get_path('user', 'blob_id', 'trash') mkdir_p(os.path.split(path)[0]) with open(path, "w") as f: f.write("bl0b") # ...and delete it - backend.delete_blob('user', 'blob_id', request, namespace='trash') + backend.delete_blob('user', 'blob_id', namespace='trash') unlink_mock.assert_any_call(backend._get_path('user', 'blob_id', 'trash')) |