Skip to content

Commit

Permalink
added tests for DISCOVERY type packets
Browse files Browse the repository at this point in the history
  • Loading branch information
zNitche committed Sep 2, 2024
1 parent 03ff201 commit cc27999
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tests/functional/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ def test_command(client: Client, server_w_tasks):

assert res.type == PacketType.CMD_RESPONSE
assert res.response == {"message": "echo hello", "numb": 1}


def test_discovery(client: Client, server_w_tasks):
res = client.get_commands()

assert res == {'test_task': {'message': 'str', 'numb': 'int'}}
2 changes: 1 addition & 1 deletion tests/mocks/mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
from iscep.type_classes import PacketContent


PACKET_BUFF = b'\x00\x01{"command": "test_cmd"}cc13d75d4a4ce43b1cc85d506ec5ed87'
PACKET_BUFF = b'\x00\x02{"command": "test_cmd"}cc13d75d4a4ce43b1cc85d506ec5ed87'
PACKET_RAW_BUFF = b'\x00\x00\x009' + PACKET_BUFF
PACKET = Packet(type=PacketType.SEND_CMD, content=PacketContent(command="test_cmd"))

0 comments on commit cc27999

Please sign in to comment.