Ejemplo n.º 1
0
def test_cmd_execute():
    """Test address, info value, size after export and parsing of CmdExecute command."""
    cmd = CmdExecute(address=100)
    assert cmd.address == 100
    assert cmd.info()

    data = cmd.export()
    assert len(data) == BaseCmd.SIZE

    cmd_parsed = CmdExecute.parse(data=data)
    assert cmd == cmd_parsed
Ejemplo n.º 2
0
def test_parse_invalid_cmd_execute_cmd_tag():
    """CmdExecute tag validity test."""
    cmd = CmdExecute(address=0)
    cmd.cmd_tag = EnumCmdTag.CALL
    data = cmd.export()
    with pytest.raises(SPSDKError):
        CmdExecute.parse(data)