def test_rand_uuid_hex(self):
        actual = data_utils.rand_uuid_hex()
        self.assertIsInstance(actual, str)
        self.assertRegexpMatches(actual, "^[0-9a-f]{32}$")

        actual2 = data_utils.rand_uuid_hex()
        self.assertNotEqual(actual, actual2)
Exemple #2
0
    def test_rand_uuid_hex(self):
        actual = data_utils.rand_uuid_hex()
        self.assertIsInstance(actual, str)
        self.assertRegexpMatches(actual, "^[0-9a-f]{32}$")

        actual2 = data_utils.rand_uuid_hex()
        self.assertNotEqual(actual, actual2)
 def test_assign_user_role_for_non_existent_tenant(self):
     # Attempt to assign a role on a non existent tenant should fail
     (user, tenant, role) = self._get_role_params()
     non_existent_tenant = data_utils.rand_uuid_hex()
     self.assertRaises(lib_exc.NotFound,
                       self.roles_client.create_user_role_on_project,
                       non_existent_tenant, user['id'], role['id'])
 def test_delete_member_with_non_existing_tenant(self):
     # Delete member with non existing tenant.
     image_id = self._create_image()
     non_exist_tenant = data_utils.rand_uuid_hex()
     self.assertRaises(lib_exc.NotFound,
                       self.image_member_client.delete_member,
                       non_exist_tenant, image_id)
Exemple #5
0
 def test_remove_user_role_non_existent_tenant(self):
     # Attempt to remove a role from a non existent tenant should fail
     (user, tenant, role) = self._get_role_params()
     self.roles_client.assign_user_role(tenant['id'], user['id'],
                                        role['id'])
     non_existent_tenant = data_utils.rand_uuid_hex()
     self.assertRaises(lib_exc.NotFound, self.roles_client.delete_user_role,
                       non_existent_tenant, user['id'], role['id'])
    def __init__(self, auth_provider):
        super(MessagingClientJSON, self).__init__(auth_provider)
        self.service = CONF.messaging.catalog_type
        self.version = '1'
        self.uri_prefix = 'v{0}'.format(self.version)

        client_id = data_utils.rand_uuid_hex()
        self.headers = {'Client-ID': client_id}
    def __init__(self, auth_provider):
        super(QueuingClientJSON, self).__init__(auth_provider)
        self.service = CONF.queuing.catalog_type
        self.version = "1"
        self.uri_prefix = "v{0}".format(self.version)

        client_id = data_utils.rand_uuid_hex()
        self.headers = {"Client-ID": client_id}
 def test_create_user_for_non_existent_domain(self):
     # Attempt to create a user in a non-existent domain should fail
     u_name = data_utils.rand_name('user')
     u_email = u_name + '@testmail.tm'
     u_password = data_utils.rand_password()
     self.assertRaises(lib_exc.NotFound, self.users_client.create_user,
                       u_name, u_password,
                       email=u_email,
                       domain_id=data_utils.rand_uuid_hex())
 def test_remove_user_role_non_existent_role(self):
     # Attempt to delete a non existent role from a user should fail
     (user, tenant, role) = self._get_role_params()
     self.roles_client.create_user_role_on_project(tenant['id'], user['id'],
                                                   role['id'])
     non_existent_role = data_utils.rand_uuid_hex()
     self.assertRaises(lib_exc.NotFound,
                       self.roles_client.delete_role_from_user_on_project,
                       tenant['id'], user['id'], non_existent_role)
 def test_remove_user_role_non_existent_tenant(self):
     # Attempt to remove a role from a non existent tenant should fail
     (user, tenant, role) = self._get_role_params()
     self.roles_client.assign_user_role(tenant['id'],
                                        user['id'],
                                        role['id'])
     non_existent_tenant = data_utils.rand_uuid_hex()
     self.assertRaises(lib_exc.NotFound, self.roles_client.delete_user_role,
                       non_existent_tenant, user['id'], role['id'])
 def test_create_user_for_non_existent_domain(self):
     # Attempt to create a user in a non-existent domain should fail
     u_name = data_utils.rand_name('user')
     u_email = u_name + '@testmail.tm'
     u_password = data_utils.rand_password()
     self.assertRaises(lib_exc.NotFound, self.users_client.create_user,
                       u_name, u_password,
                       email=u_email,
                       domain_id=data_utils.rand_uuid_hex())
 def test_remove_user_role_non_existent_role(self):
     # Attempt to delete a non existent role from a user should fail
     (user, tenant, role) = self._get_role_params()
     self.roles_client.create_user_role_on_project(tenant['id'],
                                                   user['id'],
                                                   role['id'])
     non_existent_role = data_utils.rand_uuid_hex()
     self.assertRaises(lib_exc.NotFound,
                       self.roles_client.delete_role_from_user_on_project,
                       tenant['id'], user['id'], non_existent_role)
Exemple #13
0
 def test_delete_role_non_existent(self):
     # Attempt to delete a non existent role should fail
     non_existent_role = data_utils.rand_uuid_hex()
     self.assertRaises(lib_exc.NotFound, self.roles_client.delete_role,
                       non_existent_role)
 def test_delete_non_existent_project(self):
     # Attempt to delete a non existent project should fail
     self.assertRaises(lib_exc.NotFound, self.client.delete_project,
                       data_utils.rand_uuid_hex())
 def test_delete_member_with_non_existing_tenant(self):
     # Delete member with non existing tenant.
     image_id = self._create_image()
     non_exist_tenant = data_utils.rand_uuid_hex()
     self.assertRaises(exceptions.NotFound, self.client.delete_member,
                       non_exist_tenant, image_id)
 def test_delete_non_existent_tenant(self):
     # Attempt to delete a non existent tenant should fail
     self.assertRaises(lib_exc.NotFound, self.tenants_client.delete_tenant,
                       data_utils.rand_uuid_hex())
 def test_delete_non_existent_domain(self):
     # Attempt to delete a non existent domain should fail
     self.assertRaises(lib_exc.NotFound, self.domains_client.delete_domain,
                       data_utils.rand_uuid_hex())
 def test_assign_user_role_for_non_existent_role(self):
     # Attempt to assign a non existent role to user should fail
     (user, tenant, role) = self._get_role_params()
     non_existent_role = data_utils.rand_uuid_hex()
     self.assertRaises(lib_exc.NotFound, self.roles_client.assign_user_role,
                       tenant['id'], user['id'], non_existent_role)
Exemple #19
0
 def test_assign_user_role_for_non_existent_role(self):
     # Attempt to assign a non existent role to user should fail
     (user, tenant, role) = self._get_role_params()
     non_existent_role = data_utils.rand_uuid_hex()
     self.assertRaises(lib_exc.NotFound, self.roles_client.assign_user_role,
                       tenant['id'], user['id'], non_existent_role)
 def test_delete_non_existent_project(self):
     # Attempt to delete a non existent project should fail
     self.assertRaises(exceptions.NotFound, self.client.delete_project,
                       data_utils.rand_uuid_hex())
 def test_update_non_existent_tenant(self):
     # Attempt to update a non existent tenant should fail
     self.assertRaises(lib_exc.NotFound, self.tenants_client.update_tenant,
                       data_utils.rand_uuid_hex())
 def test_delete_role_non_existent(self):
     # Attempt to delete a non existent role should fail
     non_existent_role = data_utils.rand_uuid_hex()
     self.assertRaises(lib_exc.NotFound, self.roles_client.delete_role,
                       non_existent_role)