From 7acbef762be976ab484889f411382e7bd2b8551d Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 27 Mar 2017 23:54:34 -0300 Subject: [feature] fetch new blobs from server Check what server has, what we have, compare, fetch missing. - Related: #8808 --- testing/tests/server/test_blobs_server.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'testing') 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" -- cgit v1.2.3