From 841db9f072401f2b6f40873b35c733723a54de36 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 24 Jul 2017 18:11:14 -0300 Subject: [bug] make download namespace-aware --- testing/tests/server/test_blobs_server.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'testing/tests/server') diff --git a/testing/tests/server/test_blobs_server.py b/testing/tests/server/test_blobs_server.py index 152215d1..cf370147 100644 --- a/testing/tests/server/test_blobs_server.py +++ b/testing/tests/server/test_blobs_server.py @@ -192,6 +192,17 @@ class BlobServerTestCase(unittest.TestCase): blobs_list = yield manager.remote_list(namespace=namespace) self.assertEquals(['blob_id1'], blobs_list) + @defer.inlineCallbacks + @pytest.mark.usefixtures("method_tmpdir") + def test_download_from_namespace(self): + manager = BlobManager('', self.uri, self.secret, + self.secret, 'user') + namespace, blob_id, content = 'incoming', 'blob_id1', 'test' + yield manager._encrypt_and_upload(blob_id, BytesIO(content), + namespace=namespace) + got_blob = yield manager._download_and_decrypt(blob_id, namespace) + self.assertEquals(content, got_blob[0].getvalue()) + def __touch(self, *args): path = os.path.join(*args) with open(path, 'a'): -- cgit v1.2.3