Skip to content

Commit 77c26b8

Browse files
committed
rename iter_req_id properly
1 parent c5a4a99 commit 77c26b8

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

tests/test_asyncio/test_sentinel_managed_connection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ async def test_connects_to_same_conn_object_if_same_id_and_conn_released_replica
157157
)
158158

159159

160-
async def test_connects_to_diff_address_if_noiter_req_id_replica(
160+
async def test_connects_to_diff_address_if_no_iter_req_id_replica(
161161
connection_pool_replica_mock: SentinelConnectionPool,
162162
) -> None:
163163
"""
@@ -182,7 +182,7 @@ async def test_connects_to_diff_address_if_noiter_req_id_replica(
182182
)
183183

184184

185-
async def test_connects_to_same_address_if_sameiter_req_id_master(
185+
async def test_connects_to_same_address_if_same_iter_req_id_master(
186186
connection_pool_master_mock: SentinelConnectionPool,
187187
) -> None:
188188
"""
@@ -199,7 +199,7 @@ async def test_connects_to_same_address_if_sameiter_req_id_master(
199199
)
200200

201201

202-
async def test_connects_to_same_conn_object_if_sameiter_req_id_and_released_master(
202+
async def test_connects_to_same_conn_object_if_same_iter_req_id_and_released_master(
203203
connection_pool_master_mock: SentinelConnectionPool,
204204
) -> None:
205205
"""
@@ -218,7 +218,7 @@ async def test_connects_to_same_conn_object_if_sameiter_req_id_and_released_mast
218218
)
219219

220220

221-
async def test_connects_to_same_address_if_noiter_req_id_master(
221+
async def test_connects_to_same_address_if_no_iter_req_id_master(
222222
connection_pool_master_mock: SentinelConnectionPool,
223223
) -> None:
224224
"""

tests/test_sentinel_managed_connection.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ def test_connects_to_same_address_if_same_id_replica(
8888
connection_pool_replica_mock: SentinelConnectionPool,
8989
) -> None:
9090
"""
91-
Assert that the connection address is the same if the ``_iter_req_id`` is the same
91+
Assert that the connection address is the same if the ``iter_req_id`` is the same
9292
when we are in replica mode using a
9393
:py:class:`~redis.sentinel.SentinelConnectionPool`.
9494
"""
9595
connection_for_req_1 = connection_pool_replica_mock.get_connection(
96-
"ANY", _iter_req_id=1
96+
"ANY", iter_req_id=1
9797
)
9898
assert same_address(
99-
connection_pool_replica_mock.get_connection("ANY", _iter_req_id=1),
99+
connection_pool_replica_mock.get_connection("ANY", iter_req_id=1),
100100
connection_for_req_1,
101101
)
102102

@@ -105,18 +105,18 @@ def test_connects_to_same_conn_object_if_same_id_and_conn_released_replica(
105105
connection_pool_replica_mock: SentinelConnectionPool,
106106
) -> None:
107107
"""
108-
Assert that the connection object is the same if the ``_iter_req_id`` is the same
108+
Assert that the connection object is the same if the ``iter_req_id`` is the same
109109
when we are in replica mode using a
110110
:py:class:`~redis.sentinel.SentinelConnectionPool`
111111
and if we release the connection back to the connection pool before
112112
trying to connect again.
113113
"""
114114
connection_for_req_1 = connection_pool_replica_mock.get_connection(
115-
"ANY", _iter_req_id=1
115+
"ANY", iter_req_id=1
116116
)
117117
connection_pool_replica_mock.release(connection_for_req_1)
118118
assert (
119-
connection_pool_replica_mock.get_connection("ANY", _iter_req_id=1)
119+
connection_pool_replica_mock.get_connection("ANY", iter_req_id=1)
120120
== connection_for_req_1
121121
)
122122

@@ -125,12 +125,12 @@ def test_connects_to_diff_address_if_no_iter_req_id_replica(
125125
connection_pool_replica_mock: SentinelConnectionPool,
126126
) -> None:
127127
"""
128-
Assert that the connection object is different if no _iter_req_id is supplied.
128+
Assert that the connection object is different if no iter_req_id is supplied.
129129
In reality, they can be the same, but in this case, we're not
130130
releasing the connection to the pool so they should always be different.
131131
"""
132132
connection_for_req_1 = connection_pool_replica_mock.get_connection(
133-
"ANY", _iter_req_id=1
133+
"ANY", iter_req_id=1
134134
)
135135
connection_for_random_req = connection_pool_replica_mock.get_connection("ANYY")
136136
assert not same_address(connection_for_random_req, connection_for_req_1)
@@ -156,7 +156,7 @@ def test_connects_to_same_address_if_same_iter_req_id_master(
156156
"ANY", _iter_req_id=1
157157
)
158158
assert same_address(
159-
connection_pool_master_mock.get_connection("ANY", _iter_req_id=1),
159+
connection_pool_master_mock.get_connection("ANY", iter_req_id=1),
160160
connection_for_req_1,
161161
)
162162

@@ -172,10 +172,10 @@ def test_connects_to_same_conn_object_if_same_iter_req_id_and_released_master(
172172
trying to connect again.
173173
"""
174174
connection_for_req_1 = connection_pool_master_mock.get_connection(
175-
"ANY", _iter_req_id=1
175+
"ANY", iter_req_id=1
176176
)
177177
assert same_address(
178-
connection_pool_master_mock.get_connection("ANY", _iter_req_id=1),
178+
connection_pool_master_mock.get_connection("ANY", iter_req_id=1),
179179
connection_for_req_1,
180180
)
181181

@@ -190,7 +190,7 @@ def test_connects_to_same_address_if_no_iter_req_id_master(
190190
:py:class:`~redis.sentinel.SentinelConnectionPool`.
191191
"""
192192
connection_for_req_1 = connection_pool_master_mock.get_connection(
193-
"ANY", _iter_req_id=1
193+
"ANY", iter_req_id=1
194194
)
195195
connection_for_random_req = connection_pool_master_mock.get_connection("ANYY")
196196
assert same_address(connection_for_random_req, connection_for_req_1)

0 commit comments

Comments
 (0)