mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 19:02:09 +00:00
python-pycrate: update to 0.7.11; add test.sh
Bump version 0.6.0 -> 0.7.11. Add test.sh to verify Envelope/Sequence element construction and value access. Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
committed by
Alexandru Ardelean
parent
7564f1db00
commit
0d705d716a
22
lang/python/python-pycrate/test.sh
Normal file
22
lang/python/python-pycrate/test.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$1" = python3-pycrate ] || exit 0
|
||||
|
||||
python3 - << 'EOF'
|
||||
from pycrate_core.elt import Envelope, Sequence
|
||||
from pycrate_core.base import Uint8, Uint16
|
||||
|
||||
class Msg(Envelope):
|
||||
_GEN = (
|
||||
Uint8("Type"),
|
||||
Uint16("Length"),
|
||||
)
|
||||
|
||||
m = Msg()
|
||||
m["Type"].set_val(1)
|
||||
m["Length"].set_val(42)
|
||||
assert m["Type"].get_val() == 1
|
||||
assert m["Length"].get_val() == 42
|
||||
|
||||
print("python3-pycrate OK")
|
||||
EOF
|
||||
Reference in New Issue
Block a user