Пример #1
0
def test_fill_cmd_length_not_defined():
    cmd = CmdFill(address=100, pattern=16909060)
    assert cmd.address == 100
    assert cmd.pattern == b"\x01\x02\x03\x04"

    data = cmd.export()
    assert len(data) == 16
    assert len(data) == cmd.raw_size

    cmd_parsed = parse_command(data)
    assert cmd == cmd_parsed
Пример #2
0
def test_fill_cmd_half_word():
    cmd = CmdFill(address=100, pattern=258, length=12)
    assert cmd.address == 100
    assert cmd.pattern == b"\x01\x02\x01\x02"

    data = cmd.export()
    assert len(data) == 16
    assert len(data) == cmd.raw_size

    cmd_parsed = parse_command(data)
    assert cmd == cmd_parsed