mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
Fix 16 failing unit tests to match current source behavior
- Update mock dispatcher to use subscribe-before-send pattern matching the rewritten CommandHandler.send() method - Use 32-byte pubkeys in tests for commands that now require prefix_length=32 (login, logout, statusreq, reset_path, share/export/remove contact) - Fix send_trace test path format to match flags=1 (2-byte path hashes) - Update LPP current test to expect signed wrap for values > 32.767 - Fix BinaryReqType import (moved from meshcore.parsing to meshcore.packets) - Fix register_binary_request call signature (added pubkey_prefix param) - Update timeout test to expect 'no_event_received' instead of 'timeout'
This commit is contained in:
parent
20f3bccb58
commit
ed96df197a
4 changed files with 93 additions and 54 deletions
|
|
@ -28,8 +28,9 @@ async def test_binary_response():
|
|||
|
||||
# Register the binary request first
|
||||
tag = "417db968"
|
||||
from meshcore.parsing import BinaryReqType
|
||||
reader.register_binary_request(tag, BinaryReqType.ACL, 10.0)
|
||||
from meshcore.packets import BinaryReqType
|
||||
pubkey_prefix = "993acd42fc77"
|
||||
reader.register_binary_request(pubkey_prefix, tag, BinaryReqType.ACL, 10.0)
|
||||
print(f"Registered ACL request with tag {tag}")
|
||||
|
||||
await reader.handle_rx(packet_data)
|
||||
|
|
@ -64,7 +65,7 @@ async def test_binary_response():
|
|||
print(f"Request type in response: 0x{request_type:02x} ({request_type})")
|
||||
|
||||
# Map request types to expected events
|
||||
from meshcore.parsing import BinaryReqType
|
||||
from meshcore.packets import BinaryReqType
|
||||
if request_type == BinaryReqType.STATUS.value:
|
||||
expected_event = EventType.STATUS_RESPONSE
|
||||
elif request_type == BinaryReqType.TELEMETRY.value:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue