diff options
author | Victor Shyba <victor1984@riseup.net> | 2017-03-26 18:59:37 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2017-04-04 18:27:38 +0200 |
commit | 96258086a079d54f0e1349aca41878d93102b822 (patch) | |
tree | a171bc5aec3d008b74c2417ef1e1ff47eb66e5ad /testing/tests/blobs/test_local_backend.py | |
parent | 26a65d100f91883027c17c219d018461968eda65 (diff) |
[feature] add listing to local blob db
Diffstat (limited to 'testing/tests/blobs/test_local_backend.py')
-rw-r--r-- | testing/tests/blobs/test_local_backend.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testing/tests/blobs/test_local_backend.py b/testing/tests/blobs/test_local_backend.py index 1e23606c..79f433fe 100644 --- a/testing/tests/blobs/test_local_backend.py +++ b/testing/tests/blobs/test_local_backend.py @@ -90,3 +90,18 @@ class SQLCipherBlobsClientTestCase(unittest.TestCase): assert result.getvalue() == msg assert self.manager._encrypt_and_upload.called assert not self.manager._download_and_decrypt.called + + @defer.inlineCallbacks + @pytest.mark.usefixtures("method_tmpdir") + def test_local_list_blobs(self): + self.manager._encrypt_and_upload = Mock(return_value=None) + msg = "1337" + doc = BlobDoc('mydoc_id', 'mydoc_rev', BytesIO(msg), + blob_id='myblob_id') + yield self.manager.put(doc, size=len(msg)) + doc2 = BlobDoc('mydoc_id2', 'mydoc_rev2', BytesIO(msg), + blob_id='myblob_id2') + yield self.manager.put(doc2, size=len(msg)) + blobs_list = yield self.manager.local_list() + + assert 'myblob_id' in blobs_list and 'myblob_id2' in blobs_list |