projects
/
renesas-ra-flasher
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e3f9cee
)
test: added test for unpack packets
author
Robin Krens
<robin@robinkrens.nl>
Sat, 10 Feb 2024 13:43:38 +0000
(14:43 +0100)
committer
Robin Krens
<robin@robinkrens.nl>
Sat, 10 Feb 2024 13:43:38 +0000
(14:43 +0100)
tests/test_parse.py
patch
|
blob
|
history
diff --git
a/tests/test_parse.py
b/tests/test_parse.py
index
d83e629
..
df324bf
100644
(file)
--- 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']
+