diff options
Diffstat (limited to 'testing/tests/blobs/test_blob_manager.py')
-rw-r--r-- | testing/tests/blobs/test_blob_manager.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/testing/tests/blobs/test_blob_manager.py b/testing/tests/blobs/test_blob_manager.py index 69a272c8..4d04e09d 100644 --- a/testing/tests/blobs/test_blob_manager.py +++ b/testing/tests/blobs/test_blob_manager.py @@ -130,3 +130,16 @@ class BlobManagerTestCase(unittest.TestCase): with pytest.raises(BlobAlreadyExistsError): yield self.manager.put(doc2, len(content)) self.assertFalse(self.manager._encrypt_and_upload.called) + + @defer.inlineCallbacks + @pytest.mark.usefixtures("method_tmpdir") + def test_delete_from_local_and_remote(self): + self.manager._encrypt_and_upload = Mock(return_value=None) + self.manager._delete_from_remote = Mock(return_value=None) + content = "Blob content" + doc1 = BlobDoc(BytesIO(content), 'blob_id') + yield self.manager.put(doc1, len(content)) + yield self.manager.delete('blob_id') + local_list = yield self.manager.local_list() + self.assertEquals(0, len(local_list)) + self.manager._delete_from_remote.assert_called_with('blob_id') |