本文整理汇总了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函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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)
示例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)
示例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
示例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)
示例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)
示例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'])
示例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,
{})
示例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)
示例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)
示例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)
示例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)
示例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'])
示例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)
示例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)