diff options
author | Victor Shyba <victor1984@riseup.net> | 2017-12-14 14:30:20 -0300 |
---|---|---|
committer | Victor Shyba <victor1984@riseup.net> | 2017-12-22 13:51:27 -0300 |
commit | 91da999132b9c7afbbd9259915556c61f49497ba (patch) | |
tree | 815bb66479221fd391a0346e8dbc034b302e7596 /tests | |
parent | b7ed3cbb22c9896c8491b88b2cfdea5d92787323 (diff) |
[test] test upstream from namespace
Diffstat (limited to 'tests')
-rw-r--r-- | tests/server/test_blobs_server.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/server/test_blobs_server.py b/tests/server/test_blobs_server.py index 5a895ddc..bf929386 100644 --- a/tests/server/test_blobs_server.py +++ b/tests/server/test_blobs_server.py @@ -258,6 +258,23 @@ class BlobServerTestCase(unittest.TestCase): @defer.inlineCallbacks @pytest.mark.usefixtures("method_tmpdir") + def test_upstream_from_namespace(self): + manager = BlobManager(self.tempdir, self.uri, self.secret, + self.secret, uuid4().hex, + remote_stream=self.stream_uri) + self.addCleanup(manager.close) + blob_ids = [uuid4().hex for _ in range(5)] + for i, blob_id in enumerate(blob_ids): + yield manager.local.put(blob_id, BytesIO("X" * i), size=i, + namespace='test') + yield manager._upstream(blob_ids, namespace='test') + for i, blob_id in enumerate(blob_ids): + got_blob = yield manager._download_and_decrypt(blob_id, + namespace='test') + self.assertEquals(got_blob[0].getvalue(), "X" * i) + + @defer.inlineCallbacks + @pytest.mark.usefixtures("method_tmpdir") def test_download_from_namespace(self): manager = BlobManager('', self.uri, self.secret, self.secret, uuid4().hex) |