'Role should be created, verified, and deleted.'

@decorators.idempotent_id('c62d909d-6c21-48c0-ae40-0a0760e6db5e')
def test_role_create_delete(self):

    role_name = data_utils.rand_name(name='role-test')
    body = self.roles_client.create_role(name=role_name)['role']
    self.addCleanup(test_utils.call_and_ignore_notfound_exc, self.roles_client.delete_role, body['id'])
    self.assertEqual(role_name, body['name'])
    body = self.roles_client.list_roles()['roles']
    found = [role for role in body if (role['name'] == role_name)]
    self.assertNotEmpty(found)
    body = self.roles_client.delete_role(found[0]['id'])
    body = self.roles_client.list_roles()['roles']
    found = [role for role in body if (role['name'] == role_name)]
    self.assertEmpty(found)
