X-Git-Url: https://robinkrens.nl/gitweb/?a=blobdiff_plain;f=tests%2Ftest_parse.py;h=df324bf1b5884ef72407ae3b4845848458659e94;hb=48527dafe9e6df1ac0c4c0a93feaf386da7fa6a4;hp=d83e629f89efa4992b46c7d19a234920fcb09a79;hpb=5a926ba21f47182057a38e3a62d44cec22e9d373;p=renesas-ra-flasher diff --git a/tests/test_parse.py b/tests/test_parse.py index d83e629..df324bf 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -1,4 +1,4 @@ -from flasher.flasher import calc_sum +from flasher.flasher import calc_sum, unpack_pkt import pytest def test_calc_sum(): @@ -6,3 +6,8 @@ def test_calc_sum(): assert calc_sum(0x34, ['0x00']) == (0, 0x2, 0xCA) assert calc_sum(0x00, ['0x00']) == (0, 0x02, 0xFE) +def test_unpack(): + assert unpack_pkt(b'\x81\x00\x02\x00\x00\xFE\x03') == ['0x00'] + assert unpack_pkt(b'\x81\x00\x02\x12\x00\xEC\x03') == ['0x00'] + assert unpack_pkt(b'\x81\x00\x02\x13\x00\xEB\x03') == ['0x00'] +