summaryrefslogtreecommitdiff
path: root/testing/tests/blobs/test_local_backend.py
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-03-26 18:59:37 -0300
committerdrebs <drebs@leap.se>2017-04-04 18:27:38 +0200
commit96258086a079d54f0e1349aca41878d93102b822 (patch)
treea171bc5aec3d008b74c2417ef1e1ff47eb66e5ad /testing/tests/blobs/test_local_backend.py
parent26a65d100f91883027c17c219d018461968eda65 (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.py15
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