From 96258086a079d54f0e1349aca41878d93102b822 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Sun, 26 Mar 2017 18:59:37 -0300 Subject: [feature] add listing to local blob db --- testing/tests/blobs/test_local_backend.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'testing') 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 -- cgit v1.2.3