From 947d23344c35347d44dc85dbcd699333e3004ad8 Mon Sep 17 00:00:00 2001 From: "Castulo J. Martinez" Date: Wed, 18 May 2016 10:41:00 -0700 Subject: [PATCH] Add missing test for the object storage v1 API This commit adds a missing test case for the object storage v1 API, the missing test is for listing account containers filtering the list using the prefix parameter. Change-Id: Icaf73aa88d86f92a09ff912148478031d487768b Partial-Bug: 1086590 --- tempest/api/object_storage/test_account_services.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tempest/api/object_storage/test_account_services.py b/tempest/api/object_storage/test_account_services.py index 6bab9b30e3..5983c1f281 100644 --- a/tempest/api/object_storage/test_account_services.py +++ b/tempest/api/object_storage/test_account_services.py @@ -226,6 +226,17 @@ class AccountTest(base.BaseObjectTest): self.assertEqual(len(container_list), min(limit, self.containers_count - 2)) + @test.idempotent_id('365e6fc7-1cfe-463b-a37c-8bd08d47b6aa') + def test_list_containers_with_prefix(self): + # list containers that have a name that starts with a prefix + prefix = '{0}-a'.format(CONF.resources_prefix) + params = {'prefix': prefix} + resp, container_list = self.account_client.list_account_containers( + params=params) + self.assertHeaders(resp, 'Account', 'GET') + for container in container_list: + self.assertEqual(True, container.startswith(prefix)) + @test.attr(type='smoke') @test.idempotent_id('4894c312-6056-4587-8d6f-86ffbf861f80') def test_list_account_metadata(self):