Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 72 additions & 80 deletions tests/test_reconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,84 +74,78 @@ def handle_disconnect(client, user_data, zero):
testdata = [
(
[],
bytearray(
[
0x20, # CONNACK
0x02,
0x00,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x01,
0x00,
0x20, # CONNACK
0x02,
0x00,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x02,
0x00,
]
),
bytearray([
0x20, # CONNACK
0x02,
0x00,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x01,
0x00,
0x20, # CONNACK
0x02,
0x00,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x02,
0x00,
]),
),
(
[("foo/bar", 0)],
bytearray(
[
0x20, # CONNACK
0x02,
0x00,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x01,
0x00,
0x20, # CONNACK
0x02,
0x00,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x02,
0x00,
]
),
bytearray([
0x20, # CONNACK
0x02,
0x00,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x01,
0x00,
0x20, # CONNACK
0x02,
0x00,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x02,
0x00,
]),
),
(
[("foo/bar", 0), ("bah", 0)],
bytearray(
[
0x20, # CONNACK
0x02,
0x00,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x01,
0x00,
0x00,
0x20, # CONNACK
0x02,
0x00,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x02,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x03,
0x00,
]
),
bytearray([
0x20, # CONNACK
0x02,
0x00,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x01,
0x00,
0x00,
0x20, # CONNACK
0x02,
0x00,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x02,
0x00,
0x90, # SUBACK
0x03,
0x00,
0x03,
0x00,
]),
),
]

Expand Down Expand Up @@ -228,14 +222,12 @@ def test_reconnect_not_connected() -> None:
)

mocket = Mocket(
bytearray(
[
0x20, # CONNACK
0x02,
0x00,
0x00,
]
)
bytearray([
0x20, # CONNACK
0x02,
0x00,
0x00,
])
)
mqtt_client._connection_manager = FakeConnectionManager(mocket)

Expand Down