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:
2d74aaa
)
tests: unpack read test
author
Robin Krens
<robin@robinkrens.nl>
Sat, 10 Feb 2024 14:23:14 +0000
(15:23 +0100)
committer
Robin Krens
<robin@robinkrens.nl>
Sat, 10 Feb 2024 14:23:14 +0000
(15:23 +0100)
tests/test_parse.py
patch
|
blob
|
history
diff --git
a/tests/test_parse.py
b/tests/test_parse.py
index
e629b13
..
81697d9
100644
(file)
--- a/
tests/test_parse.py
+++ b/
tests/test_parse.py
@@
-11,6
+11,9
@@
def test_unpack():
assert unpack_pkt(b'\x81\x00\x02\x12\x00\xEC\x03') == ['0x00']
assert unpack_pkt(b'\x81\x00\x02\x13\x00\xEB\x03') == ['0x00']
+def test_read_unpack():
+ assert unpack_pkt(b'\x81\x00\x04\x15\xAA\xBB\xCC\xB6\x03') == ['0xAA', '0xBB', '0xCC']
+
def test_pack_unpack():
assert unpack_pkt(pack_pkt(0x13, ['0x00','0x01','0x02'])) == ['0x00', '0x01', '0x02']
assert unpack_pkt(pack_pkt(0x34, ['0x00'])) == ['0x00']