本文整理汇总了Python中pyscsi.pyscsi.scsi.SCSI.movemedium方法的典型用法代码示例。如果您正苦于以下问题:Python SCSI.movemedium方法的具体用法?Python SCSI.movemedium怎么用?Python SCSI.movemedium使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyscsi.pyscsi.scsi.SCSI
的用法示例。
在下文中一共展示了SCSI.movemedium方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from pyscsi.pyscsi.scsi import SCSI [as 别名]
# 或者: from pyscsi.pyscsi.scsi.SCSI import movemedium [as 别名]
def main():
dev = MockMoveMedium()
dev.opcodes = smc
s = SCSI(dev)
s.device.opcodes = smc
m = s.movemedium(15, 32, 64, invert=1)
cdb = m.cdb
assert cdb[0] == s.device.opcodes.MOVE_MEDIUM.value
assert cdb[1] == 0
assert scsi_ba_to_int(cdb[2:4]) == 15
assert scsi_ba_to_int(cdb[4:6]) == 32
assert scsi_ba_to_int(cdb[6:8]) == 64
assert cdb[8] == 0
assert cdb[9] == 0
assert cdb[10] == 0x01
cdb = m.unmarshall_cdb(cdb)
assert cdb['opcode'] == s.device.opcodes.MOVE_MEDIUM.value
assert cdb['medium_transport_address'] == 15
assert cdb['source_address'] == 32
assert cdb['destination_address'] == 64
assert cdb['invert'] == 1
d = MoveMedium.unmarshall_cdb(MoveMedium.marshall_cdb(cdb))
assert d == cdb