summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-03-27 23:54:34 -0300
committerdrebs <drebs@leap.se>2017-04-19 11:37:06 +0200
commit7acbef762be976ab484889f411382e7bd2b8551d (patch)
treeeb25ee0268b6eefee4d342c3a26977f250b19b74 /testing
parent3cf6c48549ffb1c713a7b12bbd0cb0e16f49e5e9 (diff)
[feature] fetch new blobs from server
Check what server has, what we have, compare, fetch missing. - Related: #8808
Diffstat (limited to 'testing')
-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 7aa41956..cf06631b 100644
--- a/testing/tests/server/test_blobs_server.py
+++ b/testing/tests/server/test_blobs_server.py
@@ -83,3 +83,16 @@ class BlobServerTestCase(unittest.TestCase):
result = yield manager._download_and_decrypt(blob_id)
self.assertIsNotNone(result)
self.assertEquals(result[0].getvalue(), "X")
+
+ @defer.inlineCallbacks
+ @pytest.mark.usefixtures("method_tmpdir")
+ def test_fetch_missing(self):
+ manager = BlobManager(self.tempdir, self.uri, self.secret,
+ self.secret, 'user')
+ self.addCleanup(manager.close)
+ blob_id = 'remote_only_blob_id'
+ yield manager._encrypt_and_upload(blob_id, BytesIO("X"))
+ yield manager.fetch_missing()
+ result = yield manager.local.get(blob_id)
+ assert result is not None
+ assert result.getvalue() == "X"