@@ -29,47 +29,43 @@ def handle_subscribe(client, user_data, topic, qos):
2929 (
3030 "foo/bar" ,
3131 bytearray ([0x90 , 0x03 , 0x00 , 0x01 , 0x00 ]), # SUBACK
32- bytearray (
33- [
34- 0x82 , # fixed header
35- 0x0C , # remaining length
36- 0x00 ,
37- 0x01 , # message ID
38- 0x00 ,
39- 0x07 , # topic length
40- 0x66 , # topic
41- 0x6F ,
42- 0x6F ,
43- 0x2F ,
44- 0x62 ,
45- 0x61 ,
46- 0x72 ,
47- 0x00 , # QoS
48- ]
49- ),
32+ bytearray ([
33+ 0x82 , # fixed header
34+ 0x0C , # remaining length
35+ 0x00 ,
36+ 0x01 , # message ID
37+ 0x00 ,
38+ 0x07 , # topic length
39+ 0x66 , # topic
40+ 0x6F ,
41+ 0x6F ,
42+ 0x2F ,
43+ 0x62 ,
44+ 0x61 ,
45+ 0x72 ,
46+ 0x00 , # QoS
47+ ]),
5048 ),
5149 # same as before but with tuple
5250 (
5351 ("foo/bar" , 0 ),
5452 bytearray ([0x90 , 0x03 , 0x00 , 0x01 , 0x00 ]), # SUBACK
55- bytearray (
56- [
57- 0x82 , # fixed header
58- 0x0C , # remaining length
59- 0x00 ,
60- 0x01 , # message ID
61- 0x00 ,
62- 0x07 , # topic length
63- 0x66 , # topic
64- 0x6F ,
65- 0x6F ,
66- 0x2F ,
67- 0x62 ,
68- 0x61 ,
69- 0x72 ,
70- 0x00 , # QoS
71- ]
72- ),
53+ bytearray ([
54+ 0x82 , # fixed header
55+ 0x0C , # remaining length
56+ 0x00 ,
57+ 0x01 , # message ID
58+ 0x00 ,
59+ 0x07 , # topic length
60+ 0x66 , # topic
61+ 0x6F ,
62+ 0x6F ,
63+ 0x2F ,
64+ 0x62 ,
65+ 0x61 ,
66+ 0x72 ,
67+ 0x00 , # QoS
68+ ]),
7369 ),
7470 # remaining length is encoded as 2 bytes due to long topic name.
7571 (
@@ -93,47 +89,43 @@ def handle_subscribe(client, user_data, topic, qos):
9389 # SUBSCRIBE responded to by PUBLISH followed by SUBACK
9490 (
9591 "foo/bar" ,
96- bytearray (
97- [
98- 0x30 , # PUBLISH
99- 0x0C ,
100- 0x00 ,
101- 0x07 ,
102- 0x66 ,
103- 0x6F ,
104- 0x6F ,
105- 0x2F ,
106- 0x62 ,
107- 0x61 ,
108- 0x72 ,
109- 0x66 ,
110- 0x6F ,
111- 0x6F ,
112- 0x90 , # SUBACK
113- 0x03 ,
114- 0x00 ,
115- 0x01 ,
116- 0x00 ,
117- ]
118- ),
119- bytearray (
120- [
121- 0x82 , # fixed header
122- 0x0C , # remaining length
123- 0x00 ,
124- 0x01 , # message ID
125- 0x00 ,
126- 0x07 , # topic length
127- 0x66 , # topic
128- 0x6F ,
129- 0x6F ,
130- 0x2F ,
131- 0x62 ,
132- 0x61 ,
133- 0x72 ,
134- 0x00 , # QoS
135- ]
136- ),
92+ bytearray ([
93+ 0x30 , # PUBLISH
94+ 0x0C ,
95+ 0x00 ,
96+ 0x07 ,
97+ 0x66 ,
98+ 0x6F ,
99+ 0x6F ,
100+ 0x2F ,
101+ 0x62 ,
102+ 0x61 ,
103+ 0x72 ,
104+ 0x66 ,
105+ 0x6F ,
106+ 0x6F ,
107+ 0x90 , # SUBACK
108+ 0x03 ,
109+ 0x00 ,
110+ 0x01 ,
111+ 0x00 ,
112+ ]),
113+ bytearray ([
114+ 0x82 , # fixed header
115+ 0x0C , # remaining length
116+ 0x00 ,
117+ 0x01 , # message ID
118+ 0x00 ,
119+ 0x07 , # topic length
120+ 0x66 , # topic
121+ 0x6F ,
122+ 0x6F ,
123+ 0x2F ,
124+ 0x62 ,
125+ 0x61 ,
126+ 0x72 ,
127+ 0x00 , # QoS
128+ ]),
137129 ),
138130 # use list of topics for more coverage. If the range was (1, 10000), that would be
139131 # long enough to use 3 bytes for remaining length, however that would make the test
0 commit comments