本文整理汇总了Python中test.unity.rest_mock.t_rest函数的典型用法代码示例。如果您正苦于以下问题:Python t_rest函数的具体用法?Python t_rest怎么用?Python t_rest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了t_rest函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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))
示例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))
示例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))
示例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))
示例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))
示例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))
示例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))
示例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'))
示例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'))
示例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))
示例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'))
示例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'))
示例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))
示例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'))
示例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'))