summaryrefslogtreecommitdiff
path: root/testing/tests/server/test_blobs_server.py
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-03-27 23:13:58 -0300
committerdrebs <drebs@leap.se>2017-04-19 11:37:05 +0200
commit6da5ce6286336f5945e2eff5ceb0ae10116f8546 (patch)
tree198d2ebf95e348095a53373aaf0159d9c50e60bf /testing/tests/server/test_blobs_server.py
parent639569f611963d8b876f7705accba4b88a1c871d (diff)
[feature] add send_missing to send pending uploads
This method will gather a list of local docs and a list of remote docs, compare them and send docs which server doesn't have. - Related: #8807
Diffstat (limited to 'testing/tests/server/test_blobs_server.py')
-rw-r--r--testing/tests/server/test_blobs_server.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/testing/tests/server/test_blobs_server.py b/testing/tests/server/test_blobs_server.py
index a0306504..910cd985 100644
--- a/testing/tests/server/test_blobs_server.py
+++ b/testing/tests/server/test_blobs_server.py
@@ -70,3 +70,16 @@ class BlobServerTestCase(unittest.TestCase):
fd = BytesIO("save me")
with pytest.raises(BlobAlreadyExistsError):
yield manager._encrypt_and_upload('blob_id', fd)
+
+ @defer.inlineCallbacks
+ @pytest.mark.usefixtures("method_tmpdir")
+ def test_send_missing(self):
+ manager = BlobManager(self.tempdir, self.uri, self.secret,
+ self.secret, 'user')
+ self.addCleanup(manager.close)
+ blob_id = 'local_only_blob_id'
+ yield manager.local.put(blob_id, BytesIO("X"), size=1)
+ yield manager.send_missing()
+ result = yield manager._download_and_decrypt(blob_id)
+ assert result is not None
+ assert result[0].getvalue() == "X"