From 05b5c10b6c2eeb5a05963c1489e576a5e12a89c9 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 10 Aug 2017 00:39:50 -0300 Subject: [bug] enforce namespace to default on server This commit is complementary to the previous one. It adds a test for the reported bug (listing default namespace was listing others) and fixes it. -- Related: #8882 --- testing/tests/server/test_blobs_server.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'testing') diff --git a/testing/tests/server/test_blobs_server.py b/testing/tests/server/test_blobs_server.py index f57a1d2d..36709ce6 100644 --- a/testing/tests/server/test_blobs_server.py +++ b/testing/tests/server/test_blobs_server.py @@ -193,6 +193,18 @@ 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_list_default_doesnt_list_other_namespaces(self): + manager = BlobManager('', self.uri, self.secret, + self.secret, 'user') + namespace = 'incoming' + yield manager._encrypt_and_upload('blob_id1', BytesIO("1"), + namespace=namespace) + yield manager._encrypt_and_upload('blob_id2', BytesIO("2")) + blobs_list = yield manager.remote_list() + self.assertEquals(['blob_id2'], blobs_list) + @defer.inlineCallbacks @pytest.mark.usefixtures("method_tmpdir") def test_download_from_namespace(self): -- cgit v1.2.3