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

Python rest_mock.t_rest函数代码示例

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

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



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

示例1: test_iscsi_initiator_create

 def test_iscsi_initiator_create(self):
     host = UnityHost(cli=t_rest(), _id='Host_9')
     type = HostInitiatorTypeEnum.ISCSI
     iqn = "iqn.1993-08.org.debian:01:a4f95ed14d65"
     initiator = UnityHostInitiator.create(t_rest(), iqn, host, type)
     assert_that(initiator, instance_of(UnityHostInitiator))
     assert_that(initiator.initiator_id, equal_to(iqn))
开发者ID:crook,项目名称:storops,代码行数:7,代码来源:test_host.py


示例2: test_attach_alu_excced_limit

    def test_attach_alu_excced_limit(self):
        host = UnityHost(cli=t_rest(), _id='Host_11')
        lun = UnityLun(cli=t_rest(), _id="sv_2")

        def f():
            host.attach_alu(lun)
        assert_that(f, raises(UnityAttachAluExceedLimitError))
开发者ID:crook,项目名称:storops,代码行数:7,代码来源:test_host.py


示例3: test_sp_to_node_enum

 def test_sp_to_node_enum(self):
     sp = UnityStorageProcessor(_id='spa', cli=t_rest())
     assert_that(sp.to_node_enum(), equal_to(NodeEnum.SPA))
     sp = UnityStorageProcessor(_id='spb', cli=t_rest())
     assert_that(sp.to_node_enum(), equal_to(NodeEnum.SPB))
     sp = UnityStorageProcessor(_id='wrong', cli=t_rest())
     assert_that(sp.to_node_enum(), equal_to(NodeEnum.UNKNOWN))
开发者ID:crook,项目名称:storops,代码行数:7,代码来源:test_sp.py


示例4: test_fc_initiator_create

 def test_fc_initiator_create(self):
     host = UnityHost(cli=t_rest(), _id='Host_9')
     type = HostInitiatorTypeEnum.FC
     wwn = "50:00:14:40:47:B0:0C:44:50:00:14:42:D0:0C:44:10"
     initiator = UnityHostInitiator.create(t_rest(), wwn, host, type)
     assert_that(initiator, instance_of(UnityHostInitiator))
     assert_that(initiator.initiator_id, equal_to(wwn))
开发者ID:crook,项目名称:storops,代码行数:7,代码来源:test_host.py


示例5: test_attach_attached_hlu

    def test_attach_attached_hlu(self):
        host = UnityHost(cli=t_rest(), _id='Host_10')
        lun = UnityLun(cli=t_rest(), _id="sv_2")

        def f():
            host.attach_alu(lun)

        assert_that(f, raises(UnityAluAlreadyAttachedError))
开发者ID:crook,项目名称:storops,代码行数:8,代码来源:test_host.py


示例6: test_initiator_modify

 def test_initiator_modify(self):
     initiator = UnityHostInitiator(cli=t_rest(), _id='HostInitiator_2')
     assert_that(initiator.parent_host, instance_of(UnityHost))
     assert_that(initiator.parent_host.id, equal_to("Host_1"))
     host = UnityHost(cli=t_rest(), _id='Host_19')
     resp = initiator.modify(host=host)
     assert_that(resp.is_ok(), equal_to(True))
     assert_that(initiator.parent_host, instance_of(UnityHost))
开发者ID:crook,项目名称:storops,代码行数:8,代码来源:test_host.py


示例7: test_lun_modify_host_access

 def test_lun_modify_host_access(self):
     host = UnityHost(_id="Host_1", cli=t_rest())
     lun = UnityLun(_id='sv_4', cli=t_rest())
     host_access = [{'host': host, 'accessMask': HostLUNAccessEnum.BOTH}]
     lun.modify(host_access=host_access)
     lun.update()
     assert_that(lun.host_access[0].host, equal_to(host))
     assert_that(lun.host_access[0].access_mask,
                 equal_to(HostLUNAccessEnum.BOTH))
开发者ID:crook,项目名称:storops,代码行数:9,代码来源:test_lun.py


示例8: test_create_filesystem_success

 def test_create_filesystem_success(self):
     pool = UnityPool(_id='pool_1', cli=t_rest())
     fs = pool.create_filesystem(
         'nas_2', 'fs3', 3 * 1024 ** 3,
         proto=FSSupportedProtocolEnum.CIFS,
         tiering_policy=TieringPolicyEnum.AUTOTIER_HIGH)
     assert_that(fs.get_id(), equal_to('fs_12'))
开发者ID:crook,项目名称:storops,代码行数:7,代码来源:test_pool.py


示例9: test_get_properties

 def test_get_properties(self):
     port = UnityIpPort('spa_eth2', cli=t_rest())
     assert_that(port.name, equal_to('SP A Ethernet Port 2'))
     assert_that(port.short_name, equal_to('Ethernet Port 2'))
     assert_that(port.sp, instance_of(UnityStorageProcessor))
     assert_that(port.is_link_up, equal_to(True))
     assert_that(port.mac_address, equal_to('00:60:16:5C:08:E1'))
开发者ID:crook,项目名称:storops,代码行数:7,代码来源:test_port.py


示例10: test_get_properties

 def test_get_properties(self):
     dpe = UnityDpe('dpe', cli=t_rest())
     assert_that(dpe.existed, equal_to(True))
     assert_that(dpe.health, instance_of(UnityHealth))
     assert_that(dpe.needs_replacement, equal_to(False))
     assert_that(dpe.slot_number, equal_to(0))
     assert_that(dpe.name, equal_to('DPE'))
     assert_that(dpe.manufacturer, equal_to(''))
     assert_that(dpe.model, equal_to('OBERON 25 DRIVE CHASSIS'))
     assert_that(dpe.emc_part_number, equal_to('100-542-901-05'))
     assert_that(dpe.emc_serial_number, equal_to('CF2CV150500005'))
     assert_that(dpe.vendor_part_number, equal_to(''))
     assert_that(dpe.vendor_serial_number, equal_to(''))
     assert_that(dpe.bus_id, equal_to(0))
     assert_that(dpe.current_power, equal_to(429))
     assert_that(dpe.avg_power, equal_to(397))
     assert_that(dpe.max_power, equal_to(429))
     assert_that(dpe.current_temperature, equal_to(26))
     assert_that(dpe.avg_temperature, equal_to(26))
     assert_that(dpe.max_temperature, equal_to(26))
     assert_that(dpe.current_speed, equal_to(12000000000))
     assert_that(dpe.max_speed, equal_to(12000000000))
     assert_that(dpe.parent_system, instance_of(UnitySystem))
     assert_that(dpe.enclosure_type,
                 equal_to(EnclosureTypeEnum.MIRANDA_12G_SAS_DPE))
     assert_that(dpe.drive_types,
                 only_contains(DiskTypeEnum.SAS, DiskTypeEnum.SAS_FLASH_2))
开发者ID:crook,项目名称:storops,代码行数:27,代码来源:test_system.py


示例11: test_get_lun_doc

 def test_get_lun_doc(self):
     lun = UnityLun(_id='sv_2', cli=t_rest())
     doc = lun.doc
     assert_that(doc,
                 contains_string('Represents Volume, LUN, Virtual Disk.'))
     assert_that(doc, contains_string('current_node'))
     assert_that(doc, contains_string('Current SP'))
开发者ID:crook,项目名称:storops,代码行数:7,代码来源:test_lun.py


示例12: test_modify_read_write_hosts

 def test_modify_read_write_hosts(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_5')
     resp = share.modify(read_write_hosts=['Host_7'])
     assert_that(resp.is_ok(), equal_to(True))
     share.update()
     assert_that(share.read_write_hosts, instance_of(UnityHostList))
     assert_that(share.read_write_hosts[0].get_id(), equal_to('Host_7'))
开发者ID:crook,项目名称:storops,代码行数:7,代码来源:test_nfs_share.py


示例13: test_create_lun_with_muitl_property

 def test_create_lun_with_muitl_property(self):
     pool = UnityPool(_id='pool_1', cli=t_rest())
     lun = pool.create_lun("LunName", 100,
                           description="Hello World", is_thin=True,
                           is_repl_dst=True,
                           tiering_policy=TieringPolicyEnum.AUTOTIER_HIGH)
     assert_that(lun, instance_of(UnityLun))
开发者ID:crook,项目名称:storops,代码行数:7,代码来源:test_pool.py


示例14: test_create_simple_host

 def test_create_simple_host(self):
     host = UnityHost.create(t_rest(), name='host1',
                             host_type=HostTypeEnum.HOST_MANUAL,
                             os='customized os')
     assert_that(host.get_id(), equal_to('Host_11'))
     assert_that(host.name, equal_to('host1'))
     assert_that(host.os_type, equal_to('customized os'))
开发者ID:crook,项目名称:storops,代码行数:7,代码来源:test_host.py


示例15: test_lun_modify_muitl_property_except_sp

 def test_lun_modify_muitl_property_except_sp(self):
     lun = UnityLun(_id='sv_4', cli=t_rest())
     lun.modify(name="RestLun100", is_thin=True,
                description="Lun description")
     lun.update()
     assert_that(lun.name, equal_to('RestLun100'))
     assert_that(lun.description, equal_to('Lun description'))
开发者ID:crook,项目名称:storops,代码行数:7,代码来源:test_lun.py


示例16: test_add_initiator_iscsi

 def test_add_initiator_iscsi(self):
     host = UnityHost(cli=t_rest(), _id='Host_1')
     iqn = "iqn.1993-08.org.debian:01:a4f95ed19999"
     initiator = host.add_initiator(iqn)
     assert_that(initiator, instance_of(UnityHostInitiator))
     assert_that(initiator.existed, equal_to(True))
     assert_that(host.iscsi_host_initiators,
                 instance_of(UnityHostInitiatorList))
开发者ID:crook,项目名称:storops,代码行数:8,代码来源:test_host.py


示例17: test_properties

 def test_properties(self):
     _id = 'S-1-5-15-be80fa7-8ddad211-d49ba5f9-452'
     user = UnityAclUser(cli=t_rest(), _id=_id)
     assert_that(user.existed, equal_to(True))
     assert_that(user.id, equal_to(_id))
     assert_that(user.sid, equal_to(_id))
     assert_that(user.user_name, equal_to('L1PFC239208$'))
     assert_that(user.domain_name, equal_to('win2012.dev'))
开发者ID:crook,项目名称:storops,代码行数:8,代码来源:test_cifs_share.py


示例18: test_add_not_exist_initiator_with_force

 def test_add_not_exist_initiator_with_force(self):
     host = UnityHost(cli=t_rest(), _id='Host_9')
     wwn = "50:00:14:40:47:B0:0C:44:50:00:14:42:D0:0C:99:99"
     initiator = host.add_initiator(wwn, force_create=True)
     assert_that(initiator, instance_of(UnityHostInitiator))
     assert_that(initiator.existed, equal_to(True))
     assert_that(host.fc_host_initiators,
                 instance_of(UnityHostInitiatorList))
开发者ID:crook,项目名称:storops,代码行数:8,代码来源:test_host.py


示例19: test_add_initiator_not_exist

    def test_add_initiator_not_exist(self):
        host = UnityHost(cli=t_rest(), _id='Host_9')
        wwn = "50:00:14:40:47:B0:0C:44:50:00:14:42:D0:0C:99:99"

        def f():
            host.add_initiator(wwn, force_create=False)

        assert_that(f, raises(UnityHostInitiatorNotFoundError))
开发者ID:crook,项目名称:storops,代码行数:8,代码来源:test_host.py


示例20: test_delete_initiator_not_found

    def test_delete_initiator_not_found(self):
        host = UnityHost(cli=t_rest(), _id='Host_1')
        wwn = "50:00:14:40:47:B0:0C:44:50:00:14:42:99:99:99:99"

        def f():
            host.delete_initiator(wwn)

        assert_that(f, raises(UnityHostInitiatorNotFoundError))
开发者ID:crook,项目名称:storops,代码行数:8,代码来源:test_host.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python util.build_grab函数代码示例发布时间:2022-05-27
下一篇:
Python unittest.main函数代码示例发布时间: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