• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python data_utils.rand_uuid函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: test_attach_volumes_with_nonexistent_volume_id

    def test_attach_volumes_with_nonexistent_volume_id(self):
        server = self.create_server(wait_until='ACTIVE')

        self.assertRaises(lib_exc.NotFound,
                          self.client.attach_volume,
                          data_utils.rand_uuid(),
                          instance_uuid=server['id'],
                          mountpoint=self.mountpoint)
开发者ID:Tesora,项目名称:tesora-tempest,代码行数:8,代码来源:test_volumes_negative.py


示例17: test_create_nonexistent_type_id

 def test_create_nonexistent_type_id(self):
     # Should not create volume type extra spec for nonexistent volume
         # type id.
     extra_specs = {"spec2": "val1"}
     self.assertRaises(
         lib_exc.NotFound,
         self.admin_volume_types_client.create_volume_type_extra_specs,
         data_utils.rand_uuid(), extra_specs)
开发者ID:WoolenWang,项目名称:tempest,代码行数:8,代码来源:test_volume_types_extra_specs_negative.py


示例18: test_set_metadata_non_existent_server

 def test_set_metadata_non_existent_server(self):
     # Set metadata on a non-existent server should not succeed
     non_existent_server_id = data_utils.rand_uuid()
     meta = {'meta1': 'data1'}
     self.assertRaises(exceptions.NotFound,
                       self.client.set_server_metadata,
                       non_existent_server_id,
                       meta)
开发者ID:cameron-r,项目名称:tempest-configuration,代码行数:8,代码来源:test_server_metadata_negative.py


示例19: test_update_nonexistent_extra_spec_id

 def test_update_nonexistent_extra_spec_id(self):
     # Should not update volume type extra specs with nonexistent id.
     extra_spec = {"spec1": "val2"}
     self.assertRaises(
         lib_exc.BadRequest,
         self.admin_volume_types_client.update_volume_type_extra_specs,
         self.volume_type['id'], data_utils.rand_uuid(),
         extra_spec)
开发者ID:WoolenWang,项目名称:tempest,代码行数:8,代码来源:test_volume_types_extra_specs_negative.py


示例20: test_update_name_of_non_existent_server

    def test_update_name_of_non_existent_server(self):
        # Update name of a non-existent server

        nonexistent_server = data_utils.rand_uuid()
        new_name = data_utils.rand_name('server') + '_updated'

        self.assertRaises(lib_exc.NotFound, self.client.update_server,
                          nonexistent_server, name=new_name)
开发者ID:NeCTAR-RC,项目名称:tempest,代码行数:8,代码来源:test_servers_negative.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python xml_utils.xml_to_json函数代码示例发布时间:2022-05-27
下一篇:
Python choreography.InputSet类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap