Merge "Fix test_basic_metadata_definition_namespaces"

This commit is contained in:
Zuul 2022-04-14 22:43:23 +00:00 committed by Gerrit Code Review
commit 0afd087cba
2 changed files with 9 additions and 0 deletions

View File

@ -64,6 +64,7 @@ class MetadataNamespacesTest(base.BaseV2ImageAdminTest):
self.assertEqual(False, body['protected'])
# now able to delete the non-protected namespace
self.namespaces_client.delete_namespace(namespace_name)
self.namespaces_client.wait_for_resource_deletion(namespace_name)
def _cleanup_namespace(self, namespace_name):
body = self.namespaces_client.show_namespace(namespace_name)

View File

@ -16,6 +16,7 @@
from oslo_serialization import jsonutils as json
from tempest.lib.common import rest_client
from tempest.lib import exceptions as lib_exc
class NamespacesClient(rest_client.RestClient):
@ -60,6 +61,13 @@ class NamespacesClient(rest_client.RestClient):
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
def is_resource_deleted(self, id):
try:
self.show_namespace(id)
except lib_exc.NotFound:
return True
return False
def update_namespace(self, namespace, **kwargs):
"""Update a namespace.