Skip to content

Commit c6991e0

Browse files
committed
Rename vars
1 parent 1a2384a commit c6991e0

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

test/asynchronous/test_network_layer.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

test/test_network_layer.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ def test_default_timeout_is_none(self):
180180
self.assertIsNone(protocol.gettimeout)
181181

182182
def test_normal_op_msg(self):
183-
hdr = _make_header(32, 1, 99, 2013)
184-
protocol = self._make_proto_with_header(hdr)
183+
header = _make_header(32, 1, 99, 2013)
184+
protocol = self._make_proto_with_header(header)
185185
body_len, op_code, response_to, expecting_compression = protocol.process_header()
186186
self.assertEqual(body_len, 16)
187187
self.assertEqual(op_code, 2013)
@@ -190,34 +190,34 @@ def test_normal_op_msg(self):
190190

191191
def test_op_compressed(self):
192192
# OP_COMPRESSED=2012, length=35 → adjusted=35-9=26 → body=26-16=10
193-
hdr = _make_header(35, 1, 0, 2012)
194-
protocol = self._make_proto_with_header(hdr)
193+
header = _make_header(35, 1, 0, 2012)
194+
protocol = self._make_proto_with_header(header)
195195
body_len, op_code, _response_to, expecting_compression = protocol.process_header()
196196
self.assertEqual(body_len, 10)
197197
self.assertEqual(op_code, 2012)
198198
self.assertTrue(expecting_compression)
199199

200200
def test_op_compressed_length_too_small_raises(self):
201-
hdr = _make_header(25, 1, 0, 2012)
202-
protocol = self._make_proto_with_header(hdr)
201+
header = _make_header(25, 1, 0, 2012)
202+
protocol = self._make_proto_with_header(header)
203203
with self.assertRaises(ProtocolError):
204204
protocol.process_header()
205205

206206
def test_non_compressed_length_too_small_raises(self):
207-
hdr = _make_header(16, 1, 0, 2013)
208-
protocol = self._make_proto_with_header(hdr)
207+
header = _make_header(16, 1, 0, 2013)
208+
protocol = self._make_proto_with_header(header)
209209
with self.assertRaises(ProtocolError):
210210
protocol.process_header()
211211

212212
def test_length_exceeds_max_raises(self):
213-
hdr = _make_header(MAX_MESSAGE_SIZE + 1, 1, 0, 2013)
214-
protocol = self._make_proto_with_header(hdr)
213+
header = _make_header(MAX_MESSAGE_SIZE + 1, 1, 0, 2013)
214+
protocol = self._make_proto_with_header(header)
215215
with self.assertRaises(ProtocolError):
216216
protocol.process_header()
217217

218218
def test_op_reply_op_code(self):
219-
hdr = _make_header(20, 0, 0, 1)
220-
protocol = self._make_proto_with_header(hdr)
219+
header = _make_header(20, 0, 0, 1)
220+
protocol = self._make_proto_with_header(header)
221221
body_len, op_code, _response_to, expecting_compression = protocol.process_header()
222222
self.assertEqual(body_len, 4)
223223
self.assertEqual(op_code, 1)

0 commit comments

Comments
 (0)