当前位置: 首页>>代码示例>>Python>>正文


Python data_utils.rand_uuid函数代码示例

本文整理汇总了Python中tempest.common.utils.data_utils.rand_uuid函数的典型用法代码示例。如果您正苦于以下问题:Python rand_uuid函数的具体用法?Python rand_uuid怎么用?Python rand_uuid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rand_uuid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_rand_uuid

 def test_rand_uuid(self):
     actual = data_utils.rand_uuid()
     self.assertIsInstance(actual, str)
     self.assertRegexpMatches(actual, "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]"
                                      "{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
     actual2 = data_utils.rand_uuid()
     self.assertNotEqual(actual, actual2)
开发者ID:AminaMseddi,项目名称:tempest,代码行数:7,代码来源:test_data_utils.py

示例2: _associate_node_with_instance

 def _associate_node_with_instance(self):
     self.client.set_node_power_state(self.node["uuid"], "power off")
     waiters.wait_for_bm_node_status(self.client, self.node["uuid"], "power_state", "power off")
     instance_uuid = data_utils.rand_uuid()
     self.client.update_node(self.node["uuid"], instance_uuid=instance_uuid)
     self.addCleanup(self.client.update_node, uuid=self.node["uuid"], instance_uuid=None)
     return instance_uuid
开发者ID:mshalamov,项目名称:tempest,代码行数:7,代码来源:test_nodes.py

示例3: test_create_snapshot_with_nonexistent_volume_id

 def test_create_snapshot_with_nonexistent_volume_id(self):
     # Create a snapshot with nonexistent volume id
     s_name = data_utils.rand_name(self.__class__.__name__ + '-snap')
     self.assertRaises(lib_exc.NotFound,
                       self.snapshots_client.create_snapshot,
                       volume_id=data_utils.rand_uuid(),
                       display_name=s_name)
开发者ID:Tesora,项目名称:tesora-tempest,代码行数:7,代码来源:test_volumes_snapshots_negative.py

示例4: test_delete_metadata_non_existent_server

 def test_delete_metadata_non_existent_server(self):
     # Should not be able to delete metadata item from a non-existent server
     non_existent_server_id = data_utils.rand_uuid()
     self.assertRaises(exceptions.NotFound,
                       self.client.delete_server_metadata_item,
                       non_existent_server_id,
                       'd')
开发者ID:cameron-r,项目名称:tempest-configuration,代码行数:7,代码来源:test_server_metadata_negative.py

示例5: test_rebuild_non_existent_server

 def test_rebuild_non_existent_server(self):
     # Rebuild a non existent server
     nonexistent_server = data_utils.rand_uuid()
     self.assertRaises(lib_exc.NotFound,
                       self.client.rebuild_server,
                       nonexistent_server,
                       self.image_ref_alt)
开发者ID:NeCTAR-RC,项目名称:tempest,代码行数:7,代码来源:test_servers_negative.py

示例6: test_get_nonexistent_volume_type_id

 def test_get_nonexistent_volume_type_id(self):
     # Should not get volume type extra spec for nonexistent type id.
     extra_specs = {"spec1": "val1"}
     self.assertRaises(
         lib_exc.NotFound,
         self.admin_volume_types_client.show_volume_type_extra_specs,
         data_utils.rand_uuid(), extra_specs.keys()[0])
开发者ID:devfaz,项目名称:tempest,代码行数:7,代码来源:test_volume_types_extra_specs_negative.py

示例7: test_delete_nonexistent_volume_type_id

 def test_delete_nonexistent_volume_type_id(self):
     # Should not delete volume type extra spec for nonexistent
     # type id.
     self.assertRaises(
         lib_exc.NotFound,
         self.admin_volume_types_client.delete_volume_type_extra_specs,
         data_utils.rand_uuid(), "spec1")
开发者ID:WoolenWang,项目名称:tempest,代码行数:7,代码来源:test_volume_types_extra_specs_negative.py

示例8: test_get_nonexistent_extra_spec_id

 def test_get_nonexistent_extra_spec_id(self):
     # Should not get volume type extra spec for nonexistent extra spec
         # id.
     self.assertRaises(
         lib_exc.NotFound,
         self.admin_volume_types_client.show_volume_type_extra_specs,
         self.volume_type['id'], data_utils.rand_uuid())
开发者ID:WoolenWang,项目名称:tempest,代码行数:7,代码来源:test_volume_types_extra_specs_negative.py

示例9: populate_spam_table

    def populate_spam_table(self, table_name, usercount, itemcount):

        dates = ['2013-12-0%sT16:00:00.000001' % i for i in range(1, 8)]
        from_headers = ["%[email protected]" % rand_name() for _ in range(10)]
        to_headers = ["%[email protected]" % rand_name() for _ in range(10)]
        emails = []

        new_items = []
        for _ in range(usercount):
            email = "%[email protected]" % rand_name()
            emails.append(email)

            for item in range(itemcount):
                message_id = rand_uuid()
                date = random.choice(dates)
                # put item
                item = {
                    "user_id": {"S": email},
                    "date_message_id": {"S": date + "#" + message_id},
                    "message_id": {"S": message_id},
                    "from_header": {"S": random.choice(from_headers)},
                    "to_header": {"S": random.choice(to_headers)},
                }
                new_items.append(item)
                self.conn.put_item(table_name, item)
        return new_items
开发者ID:chjwang,项目名称:magnetodb,代码行数:26,代码来源:test_load_1.py

示例10: test_server_metadata_non_existent_server

 def test_server_metadata_non_existent_server(self):
     # GET on a non-existent server should not succeed
     non_existent_server_id = data_utils.rand_uuid()
     self.assertRaises(exceptions.NotFound,
                       self.client.get_server_metadata_item,
                       non_existent_server_id,
                       'test2')
开发者ID:cameron-r,项目名称:tempest-configuration,代码行数:7,代码来源:test_server_metadata_negative.py

示例11: test_create_image_from_nonexistent_server

 def test_create_image_from_nonexistent_server(self):
     # An image should not be created with invalid server id
     # Create a new image with invalid server id
     nonexistent_server_id = data_utils.rand_uuid()
     name = data_utils.rand_name('image')
     meta = {'image_type': 'test'}
     self.assertRaises(exceptions.NotFound, self.__create_image__,
                       nonexistent_server_id, name, meta)
开发者ID:cameron-r,项目名称:tempest-configuration,代码行数:8,代码来源:test_images_negative.py

示例12: test_create_port_duplicated_port_uuid

    def test_create_port_duplicated_port_uuid(self):
        node_id = self.node['uuid']
        address = data_utils.rand_mac_address()
        uuid = data_utils.rand_uuid()

        self.create_port(node_id=node_id, address=address, uuid=uuid)
        self.assertRaises(exc.Conflict, self.create_port, node_id=node_id,
                          address=address, uuid=uuid)
开发者ID:CiscoSystems,项目名称:tempest,代码行数:8,代码来源:test_ports_negative.py

示例13: test_set_nonexistent_image_metadata_item

 def test_set_nonexistent_image_metadata_item(self):
     # Negative test: Metadata item should not be set to a
     # nonexistent image
     meta = {'key1': 'alt'}
     self.assertRaises(exceptions.NotFound,
                       self.client.set_image_metadata_item,
                       data_utils.rand_uuid(), 'key1',
                       meta)
开发者ID:mrda,项目名称:tempest,代码行数:8,代码来源:test_image_metadata_negative.py

示例14: test_delete_nonexistent_volume_type_id

 def test_delete_nonexistent_volume_type_id(self):
     # Should not delete volume type extra spec for nonexistent
         # type id.
     extra_specs = {"spec1": "val1"}
     self.assertRaises(
         lib_exc.NotFound,
         self.volume_types_client.delete_volume_type_extra_specs,
         data_utils.rand_uuid(), extra_specs.keys()[0])
开发者ID:bigswitch,项目名称:tempest,代码行数:8,代码来源:test_volume_types_extra_specs_negative.py

示例15: test_update_metadata_non_existent_server

 def test_update_metadata_non_existent_server(self):
     # An update should not happen for a non-existent server
     non_existent_server_id = data_utils.rand_uuid()
     meta = {'key1': 'value1', 'key2': 'value2'}
     self.assertRaises(exceptions.NotFound,
                       self.client.update_server_metadata,
                       non_existent_server_id,
                       meta)
开发者ID:cameron-r,项目名称:tempest-configuration,代码行数:8,代码来源:test_server_metadata_negative.py


注:本文中的tempest.common.utils.data_utils.rand_uuid函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。