@@ -181,8 +181,8 @@ async def test_default_timeout_is_none(self):
181181 self .assertIsNone (protocol .gettimeout )
182182
183183 async def test_normal_op_msg (self ):
184- hdr = _make_header (32 , 1 , 99 , 2013 )
185- protocol = await self ._make_proto_with_header (hdr )
184+ header = _make_header (32 , 1 , 99 , 2013 )
185+ protocol = await self ._make_proto_with_header (header )
186186 body_len , op_code , response_to , expecting_compression = protocol .process_header ()
187187 self .assertEqual (body_len , 16 )
188188 self .assertEqual (op_code , 2013 )
@@ -191,34 +191,34 @@ async def test_normal_op_msg(self):
191191
192192 async def test_op_compressed (self ):
193193 # OP_COMPRESSED=2012, length=35 → adjusted=35-9=26 → body=26-16=10
194- hdr = _make_header (35 , 1 , 0 , 2012 )
195- protocol = await self ._make_proto_with_header (hdr )
194+ header = _make_header (35 , 1 , 0 , 2012 )
195+ protocol = await self ._make_proto_with_header (header )
196196 body_len , op_code , _response_to , expecting_compression = protocol .process_header ()
197197 self .assertEqual (body_len , 10 )
198198 self .assertEqual (op_code , 2012 )
199199 self .assertTrue (expecting_compression )
200200
201201 async def test_op_compressed_length_too_small_raises (self ):
202- hdr = _make_header (25 , 1 , 0 , 2012 )
203- protocol = await self ._make_proto_with_header (hdr )
202+ header = _make_header (25 , 1 , 0 , 2012 )
203+ protocol = await self ._make_proto_with_header (header )
204204 with self .assertRaises (ProtocolError ):
205205 protocol .process_header ()
206206
207207 async def test_non_compressed_length_too_small_raises (self ):
208- hdr = _make_header (16 , 1 , 0 , 2013 )
209- protocol = await self ._make_proto_with_header (hdr )
208+ header = _make_header (16 , 1 , 0 , 2013 )
209+ protocol = await self ._make_proto_with_header (header )
210210 with self .assertRaises (ProtocolError ):
211211 protocol .process_header ()
212212
213213 async def test_length_exceeds_max_raises (self ):
214- hdr = _make_header (MAX_MESSAGE_SIZE + 1 , 1 , 0 , 2013 )
215- protocol = await self ._make_proto_with_header (hdr )
214+ header = _make_header (MAX_MESSAGE_SIZE + 1 , 1 , 0 , 2013 )
215+ protocol = await self ._make_proto_with_header (header )
216216 with self .assertRaises (ProtocolError ):
217217 protocol .process_header ()
218218
219219 async def test_op_reply_op_code (self ):
220- hdr = _make_header (20 , 0 , 0 , 1 )
221- protocol = await self ._make_proto_with_header (hdr )
220+ header = _make_header (20 , 0 , 0 , 1 )
221+ protocol = await self ._make_proto_with_header (header )
222222 body_len , op_code , _response_to , expecting_compression = protocol .process_header ()
223223 self .assertEqual (body_len , 4 )
224224 self .assertEqual (op_code , 1 )
0 commit comments