Skip to content

Commit 6b0f92f

Browse files
authored
Merge pull request #247 from adafruit/ruff-format-reconnect-tests
ruff format reconnect tests
2 parents 336da87 + 40a4fa9 commit 6b0f92f

File tree

1 file changed

+72
-80
lines changed

1 file changed

+72
-80
lines changed

tests/test_reconnect.py

+72-80
Original file line numberDiff line numberDiff line change
@@ -74,84 +74,78 @@ def handle_disconnect(client, user_data, zero):
7474
testdata = [
7575
(
7676
[],
77-
bytearray(
78-
[
79-
0x20, # CONNACK
80-
0x02,
81-
0x00,
82-
0x00,
83-
0x90, # SUBACK
84-
0x03,
85-
0x00,
86-
0x01,
87-
0x00,
88-
0x20, # CONNACK
89-
0x02,
90-
0x00,
91-
0x00,
92-
0x90, # SUBACK
93-
0x03,
94-
0x00,
95-
0x02,
96-
0x00,
97-
]
98-
),
77+
bytearray([
78+
0x20, # CONNACK
79+
0x02,
80+
0x00,
81+
0x00,
82+
0x90, # SUBACK
83+
0x03,
84+
0x00,
85+
0x01,
86+
0x00,
87+
0x20, # CONNACK
88+
0x02,
89+
0x00,
90+
0x00,
91+
0x90, # SUBACK
92+
0x03,
93+
0x00,
94+
0x02,
95+
0x00,
96+
]),
9997
),
10098
(
10199
[("foo/bar", 0)],
102-
bytearray(
103-
[
104-
0x20, # CONNACK
105-
0x02,
106-
0x00,
107-
0x00,
108-
0x90, # SUBACK
109-
0x03,
110-
0x00,
111-
0x01,
112-
0x00,
113-
0x20, # CONNACK
114-
0x02,
115-
0x00,
116-
0x00,
117-
0x90, # SUBACK
118-
0x03,
119-
0x00,
120-
0x02,
121-
0x00,
122-
]
123-
),
100+
bytearray([
101+
0x20, # CONNACK
102+
0x02,
103+
0x00,
104+
0x00,
105+
0x90, # SUBACK
106+
0x03,
107+
0x00,
108+
0x01,
109+
0x00,
110+
0x20, # CONNACK
111+
0x02,
112+
0x00,
113+
0x00,
114+
0x90, # SUBACK
115+
0x03,
116+
0x00,
117+
0x02,
118+
0x00,
119+
]),
124120
),
125121
(
126122
[("foo/bar", 0), ("bah", 0)],
127-
bytearray(
128-
[
129-
0x20, # CONNACK
130-
0x02,
131-
0x00,
132-
0x00,
133-
0x90, # SUBACK
134-
0x03,
135-
0x00,
136-
0x01,
137-
0x00,
138-
0x00,
139-
0x20, # CONNACK
140-
0x02,
141-
0x00,
142-
0x00,
143-
0x90, # SUBACK
144-
0x03,
145-
0x00,
146-
0x02,
147-
0x00,
148-
0x90, # SUBACK
149-
0x03,
150-
0x00,
151-
0x03,
152-
0x00,
153-
]
154-
),
123+
bytearray([
124+
0x20, # CONNACK
125+
0x02,
126+
0x00,
127+
0x00,
128+
0x90, # SUBACK
129+
0x03,
130+
0x00,
131+
0x01,
132+
0x00,
133+
0x00,
134+
0x20, # CONNACK
135+
0x02,
136+
0x00,
137+
0x00,
138+
0x90, # SUBACK
139+
0x03,
140+
0x00,
141+
0x02,
142+
0x00,
143+
0x90, # SUBACK
144+
0x03,
145+
0x00,
146+
0x03,
147+
0x00,
148+
]),
155149
),
156150
]
157151

@@ -228,14 +222,12 @@ def test_reconnect_not_connected() -> None:
228222
)
229223

230224
mocket = Mocket(
231-
bytearray(
232-
[
233-
0x20, # CONNACK
234-
0x02,
235-
0x00,
236-
0x00,
237-
]
238-
)
225+
bytearray([
226+
0x20, # CONNACK
227+
0x02,
228+
0x00,
229+
0x00,
230+
])
239231
)
240232
mqtt_client._connection_manager = FakeConnectionManager(mocket)
241233

0 commit comments

Comments
 (0)