summaryrefslogtreecommitdiff
path: root/testing/tests/server
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-07-24 18:11:14 -0300
committerVictor Shyba <victor1984@riseup.net>2017-08-03 05:33:01 -0300
commit841db9f072401f2b6f40873b35c733723a54de36 (patch)
treedb64800de5858aca58f42547e4086a79274e7dfd /testing/tests/server
parent8fc244cb0946f46ba9aff019b70568d08a226b29 (diff)
[bug] make download namespace-aware
Diffstat (limited to 'testing/tests/server')
-rw-r--r--testing/tests/server/test_blobs_server.py11
1 files changed, 11 insertions, 0 deletions
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'):