本文整理汇总了Python中tempest.lib.common.utils.data_utils.rand_uuid_hex函数的典型用法代码示例。如果您正苦于以下问题:Python rand_uuid_hex函数的具体用法?Python rand_uuid_hex怎么用?Python rand_uuid_hex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rand_uuid_hex函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_identity_provider_create_with_remote_ids
def test_identity_provider_create_with_remote_ids(self):
idp_id = data_utils.rand_uuid_hex()
remote_ids = [data_utils.rand_uuid_hex(), data_utils.rand_uuid_hex()]
idp_ref = fixtures.idp_ref(remote_ids=remote_ids)
idp = self._create_idp(idp_id, idp_ref)
self._assert_identity_provider_attributes(idp, idp_id, idp_ref)
开发者ID:Lshutao,项目名称:keystone,代码行数:7,代码来源:test_identity_providers.py
示例2: test_rand_uuid_hex
def test_rand_uuid_hex(self):
actual = data_utils.rand_uuid_hex()
self.assertIsInstance(actual, str)
self.assertRegex(actual, "^[0-9a-f]{32}$")
actual2 = data_utils.rand_uuid_hex()
self.assertNotEqual(actual, actual2)
开发者ID:dwalleck,项目名称:tempest,代码行数:7,代码来源:test_data_utils.py
示例3: test_service_provider_create_with_relay_state_prefix
def test_service_provider_create_with_relay_state_prefix(self):
sp_id = data_utils.rand_uuid_hex()
sp_ref = fixtures.sp_ref(
enabled=True, relay_state_prefix=data_utils.rand_uuid_hex())
sp = self._create_sp(sp_id, sp_ref)
self._assert_service_provider_attributes(sp, sp_id, sp_ref)
开发者ID:Lshutao,项目名称:keystone,代码行数:7,代码来源:test_service_providers.py
示例4: _create_identity_provider_and_mapping
def _create_identity_provider_and_mapping(self):
# Create an identity provider
idp_id = data_utils.rand_uuid_hex()
self._create_idp(idp_id, fixtures.idp_ref(enabled=True))
# Create a mapping rule
mapping_id = data_utils.rand_uuid_hex()
self.mappings_client.create_mapping_rule(
mapping_id, fixtures.mapping_ref())
self.addCleanup(self.mappings_client.delete_mapping_rule, mapping_id)
return idp_id, mapping_id
开发者ID:Lshutao,项目名称:keystone,代码行数:12,代码来源:test_identity_providers.py
示例5: test_add_protocol_to_identity_provider_unknown_mapping
def test_add_protocol_to_identity_provider_unknown_mapping(self):
# Create an identity provider
idp_id = data_utils.rand_uuid_hex()
self._create_idp(idp_id, fixtures.idp_ref(enabled=True))
# Now we try to add a protocol to the identity provider using
# a non existent mapping ID
mapping_id = data_utils.rand_uuid_hex()
protocol_id = data_utils.rand_uuid_hex()
protocol = self._create_protocol(idp_id, protocol_id, mapping_id)
self._assert_protocol_attributes(protocol, protocol_id, mapping_id)
开发者ID:Lshutao,项目名称:keystone,代码行数:12,代码来源:test_identity_providers.py
示例6: test_update_protocol_from_identity_provider_unknown_mapping
def test_update_protocol_from_identity_provider_unknown_mapping(self):
idp_id, mapping_id = self._create_identity_provider_and_mapping()
# Add a protocol to the identity provider
protocol_id = data_utils.rand_uuid_hex()
self._create_protocol(idp_id, protocol_id, mapping_id)
# Update the identity provider protocol using a non existent
# mapping_id
new_mapping_id = data_utils.rand_uuid_hex()
protocol = self.idps_client.update_protocol_mapping(
idp_id, protocol_id, new_mapping_id)['protocol']
self._assert_protocol_attributes(protocol, protocol_id, new_mapping_id)
开发者ID:Lshutao,项目名称:keystone,代码行数:14,代码来源:test_identity_providers.py
示例7: test_update_image_owner_param
def test_update_image_owner_param(self):
random_id_1 = data_utils.rand_uuid_hex()
image = self.admin_client.create_image(
container_format='bare', disk_format='raw', owner=random_id_1)
self.addCleanup(self.admin_client.delete_image, image['id'])
created_image_info = self.admin_client.show_image(image['id'])
random_id_2 = data_utils.rand_uuid_hex()
self.admin_client.update_image(
image['id'], [dict(replace="/owner", value=random_id_2)])
updated_image_info = self.admin_client.show_image(image['id'])
self.assertEqual(random_id_2, updated_image_info['owner'])
self.assertNotEqual(created_image_info['owner'],
updated_image_info['owner'])
开发者ID:masayukig,项目名称:tempest,代码行数:15,代码来源:test_images.py
示例8: test_mapping_rules_create_without_mandatory_attributes_fails
def test_mapping_rules_create_without_mandatory_attributes_fails(self):
mapping_id = data_utils.rand_uuid_hex()
self.assertRaises(
lib_exc.BadRequest,
self.mappings_client.create_mapping_rule,
mapping_id,
{})
开发者ID:lbragstad,项目名称:keystone,代码行数:7,代码来源:test_mapping_rules.py
示例9: test_delete_member_with_non_existing_tenant
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_image_member,
image_id, non_exist_tenant)
开发者ID:Juniper,项目名称:tempest,代码行数:7,代码来源:test_image_members_negative.py
示例10: _setup_mapping
def _setup_mapping(self):
self.mapping_id = data_utils.rand_uuid_hex()
mapping_remote_type = CONF.fed_scenario.mapping_remote_type
mapping_user_name = CONF.fed_scenario.mapping_user_name
mapping_group_name = CONF.fed_scenario.mapping_group_name
mapping_group_domain_name = CONF.fed_scenario.mapping_group_domain_name
rules = [{
'local': [
{
'user': {'name': mapping_user_name}
},
{
'group': {
'domain': {'name': mapping_group_domain_name},
'name': mapping_group_name
}
}
],
'remote': [
{
'type': mapping_remote_type
}
]
}]
mapping_ref = {'rules': rules}
self.mappings_client.create_mapping_rule(self.mapping_id, mapping_ref)
self.addCleanup(
self.mappings_client.delete_mapping_rule, self.mapping_id)
开发者ID:lbragstad,项目名称:keystone,代码行数:29,代码来源:test_federated_authentication.py
示例11: test_update_protocol_from_identity_provider_unknown_mapping
def test_update_protocol_from_identity_provider_unknown_mapping(self):
idp_id, mapping_id = self._create_identity_provider_and_mapping()
# Add a protocol to the identity provider
protocol_id = data_utils.rand_uuid_hex()
self._create_protocol(idp_id, protocol_id, mapping_id)
# Update the identity provider protocol using a non existent
# mapping_id
new_mapping_id = data_utils.rand_uuid_hex()
self.assertRaises(
lib_exc.BadRequest,
self.idps_client.update_protocol_mapping,
idp_id,
protocol_id,
new_mapping_id)
开发者ID:roopakparikh,项目名称:keystone,代码行数:16,代码来源:test_identity_providers.py
示例12: test_identity_provider_get
def test_identity_provider_get(self):
idp_id = data_utils.rand_uuid_hex()
idp_create = self._create_idp(idp_id, fixtures.idp_ref())
idp_get = self.idps_client.show_identity_provider(
idp_id)['identity_provider']
self._assert_identity_provider_attributes(idp_get, idp_id, idp_create)
开发者ID:Lshutao,项目名称:keystone,代码行数:7,代码来源:test_identity_providers.py
示例13: test_assign_user_role_for_non_existent_tenant
def test_assign_user_role_for_non_existent_tenant(self):
# Attempt to assign a role on a non existent tenant should fail
(user, _, 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'])
开发者ID:Juniper,项目名称:tempest,代码行数:7,代码来源:test_roles_negative.py
示例14: test_add_protocol_to_identity_provider
def test_add_protocol_to_identity_provider(self):
idp_id, mapping_id = self._create_identity_provider_and_mapping()
# Now we try to add a protocol to the identity provider
protocol_id = data_utils.rand_uuid_hex()
protocol = self._create_protocol(idp_id, protocol_id, mapping_id)
self._assert_protocol_attributes(protocol, protocol_id, mapping_id)
开发者ID:Lshutao,项目名称:keystone,代码行数:8,代码来源:test_identity_providers.py
示例15: test_update_mapping_from_identity_provider_protocol
def test_update_mapping_from_identity_provider_protocol(self):
idp_id, mapping_id = self._create_identity_provider_and_mapping()
# Add a protocol to the identity provider
protocol_id = data_utils.rand_uuid_hex()
protocol = self._create_protocol(idp_id, protocol_id, mapping_id)
# Create another mapping
new_mapping_id = data_utils.rand_uuid_hex()
self.mappings_client.create_mapping_rule(
new_mapping_id, fixtures.mapping_ref())
# Update the identity provider protocol
protocol = self.idps_client.update_protocol_mapping(
idp_id, protocol_id, new_mapping_id)['protocol']
self._assert_protocol_attributes(protocol, protocol_id, new_mapping_id)
开发者ID:Lshutao,项目名称:keystone,代码行数:17,代码来源:test_identity_providers.py
示例16: test_mapping_rule_update
def test_mapping_rule_update(self):
mapping_id = data_utils.rand_uuid_hex()
mapping_ref = fixtures.mapping_ref()
mapping = self._create_mapping_rule(mapping_id, mapping_ref)
new_local = [{'group': {'id': data_utils.rand_uuid_hex()}}]
mapping_ref['rules'][0]['local'] = new_local
mapping = self.mappings_client.update_mapping_rule(
mapping_id, mapping_ref)['mapping']
self._assert_mapping_rules_attributes(
mapping, mapping_id, mapping_ref)
mapping_get = self.mappings_client.show_mapping_rule(mapping_id)[
'mapping']
self._assert_mapping_rules_attributes(
mapping_get, mapping_id, mapping)
开发者ID:lbragstad,项目名称:keystone,代码行数:17,代码来源:test_mapping_rules.py
示例17: test_service_provider_get
def test_service_provider_get(self):
sp_id = data_utils.rand_uuid_hex()
sp_create = self._create_sp(sp_id, fixtures.sp_ref())
sp_get = self.sps_client.show_service_provider(sp_id)[
'service_provider']
self._assert_service_provider_attributes(sp_get, sp_id, sp_create)
开发者ID:Lshutao,项目名称:keystone,代码行数:8,代码来源:test_service_providers.py
示例18: test_service_provider_update_with_bad_attributes_fails
def test_service_provider_update_with_bad_attributes_fails(self):
sp_id = data_utils.rand_uuid_hex()
self._create_sp(sp_id, fixtures.sp_ref())
# The auth_url must follow a URL regex
self.assertRaises(
lib_exc.BadRequest,
self.sps_client.update_service_provider,
sp_id,
auth_url=data_utils.rand_uuid_hex())
# The sp_url must follow a URL regex
self.assertRaises(
lib_exc.BadRequest,
self.sps_client.update_service_provider,
sp_id,
auth_url=data_utils.rand_uuid_hex())
开发者ID:Lshutao,项目名称:keystone,代码行数:17,代码来源:test_service_providers.py
示例19: test_create_user_for_non_existent_domain
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,
name=u_name, password=u_password,
email=u_email,
domain_id=data_utils.rand_uuid_hex())
开发者ID:Juniper,项目名称:tempest,代码行数:9,代码来源:test_users_negative.py
示例20: test_mapping_rules_get
def test_mapping_rules_get(self):
mapping_id = data_utils.rand_uuid_hex()
mapping_create = self._create_mapping_rule(
mapping_id, self._MAPPING_REF)
mapping_get = self.mappings_client.show_mapping_rule(mapping_id)[
'mapping']
self._assert_mapping_rules_attributes(
mapping_get, mapping_id, mapping_create)
开发者ID:lbragstad,项目名称:keystone,代码行数:9,代码来源:test_mapping_rules.py
注:本文中的tempest.lib.common.utils.data_utils.rand_uuid_hex函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论