Use addClassResourceCleanup in account service test

This patch is to use addClassResourceCleanup for the
account service test.

Change-Id: I7094879126a83eabb5a6e1fafe3ce0ccfa8b4e7c
This commit is contained in:
OTSUKA, Yuanying 2017-12-15 16:21:46 +09:00
parent 3f697b3c0a
commit 19355c9607

View File

@ -44,14 +44,13 @@ class AccountTest(base.BaseObjectTest):
for i in range(ord('a'), ord('f') + 1): for i in range(ord('a'), ord('f') + 1):
name = data_utils.rand_name(name='%s-' % six.int2byte(i)) name = data_utils.rand_name(name='%s-' % six.int2byte(i))
cls.container_client.update_container(name) cls.container_client.update_container(name)
cls.addClassResourceCleanup(base.delete_containers,
[name],
cls.container_client,
cls.object_client)
cls.containers.append(name) cls.containers.append(name)
cls.containers_count = len(cls.containers) cls.containers_count = len(cls.containers)
@classmethod
def resource_cleanup(cls):
cls.delete_containers()
super(AccountTest, cls).resource_cleanup()
@decorators.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('3499406a-ae53-4f8c-b43a-133d4dc6fe3f') @decorators.idempotent_id('3499406a-ae53-4f8c-b43a-133d4dc6fe3f')
def test_list_containers(self): def test_list_containers(self):