def test_command_std_frame_length_check_error(self, chipset):
cmd = HEX('0000ff 05fb d4 00 313233 96 00')
rsp = HEX('0000ff 04fb d5 01 343536 8b 00')
chipset.transport.read.side_effect = [ACK(), rsp]
with pytest.raises(IOError) as excinfo:
chipset.command(0, b'123', 1.0)
assert excinfo.value.errno == errno.EIO
assert chipset.transport.read.mock_calls == [call(100), call(1000)]
assert chipset.transport.write.mock_calls == [call(cmd)]
评论列表
文章目录