Exemplo n.º 1
0
myArray = [chr(0x0B), chr(0x04), chr(0x01), chr(0x01), chr(0x02), chr(0x10)]
SuccessArray = [
    chr(0x10),
    chr(0x00),
    chr(0x00),
    chr(0x30),
    chr(0x2c),
    chr(len("XY Position Set to (257,528)"))
]
SuccessArray = OpCodeUtilities().AppendStringToByteArray(
    SuccessArray, "XY Position Set to (257,528)")
SuccessString = OpCodeUtilities().GetStringFromByteArray(SuccessArray)
print CheckEquality(
    actionParser.GetActionOpCodeFromByteArray(myArray, otherDevice),
    SuccessString, 'Action Op Code: Set XY 1')
print CheckEquality(otherDevice.GetFrontEndXY(), (257, 528),
                    'Action Op Code: Set XY 2')

myArray = [
    chr(0x0C),
    chr(0x04),
    chr(0x01),
    chr(0x01),
    chr(0x02),
    chr(0x10),
    chr(0x02),
    chr(0x05),
    chr(0x50),
    chr(0x02),
    chr(0x02),
    chr(0x01),