mirror of
https://github.com/markqvist/rnsh.git
synced 2025-08-08 14:42:11 -04:00
Protocol versioning, announce period option, old API workaround
This commit is contained in:
parent
9fe37b57ed
commit
da3b390058
6 changed files with 293 additions and 103 deletions
15
tests/test_rnsh.py
Normal file
15
tests/test_rnsh.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
import logging
|
||||
import rnsh.rnsh
|
||||
logging.getLogger().setLevel(logging.DEBUG)
|
||||
|
||||
|
||||
def test_check_magic():
|
||||
magic = rnsh.rnsh._PROTOCOL_VERSION_0
|
||||
# magic for version 0 is generated, make sure it comes out as expected
|
||||
assert magic == 0xdeadbeef00000000
|
||||
# verify the checker thinks it's right
|
||||
assert rnsh.rnsh._protocol_check_magic(magic)
|
||||
# scramble the magic
|
||||
magic = magic | 0x00ffff0000000000
|
||||
# make sure it fails now
|
||||
assert not rnsh.rnsh._protocol_check_magic(magic)
|
Loading…
Add table
Add a link
Reference in a new issue