|
1 | 1 | import socket
|
| 2 | +import uuid |
2 | 3 | from typing import Tuple
|
3 |
| -from unittest.mock import AsyncMock, ANY |
| 4 | +from unittest.mock import ANY, AsyncMock |
4 | 5 |
|
5 | 6 | import pytest
|
6 | 7 | import pytest_asyncio
|
7 |
| -import uuid |
8 | 8 | from redis.asyncio.retry import Retry
|
9 |
| -from redis.commands.core import AsyncScanCommands |
10 | 9 | from redis.asyncio.sentinel import (
|
11 | 10 | Sentinel,
|
12 | 11 | SentinelConnectionPool,
|
13 | 12 | SentinelManagedConnection,
|
14 | 13 | )
|
15 | 14 | from redis.backoff import NoBackoff
|
| 15 | +from redis.commands.core import AsyncScanCommands |
16 | 16 |
|
17 | 17 | from .compat import mock
|
18 | 18 |
|
@@ -251,20 +251,20 @@ async def test_connects_to_same_address_if_no_iter_req_id_master(
|
251 | 251 | async def test_scan_iter_family_executes_commands_with_same_iter_req_id():
|
252 | 252 | """Assert that all calls to execute_command receives the _iter_req_id kwarg"""
|
253 | 253 | with mock.patch.object(
|
254 |
| - AsyncScanCommands, |
255 |
| - "execute_command", |
256 |
| - AsyncMock(return_value=(0, [])) |
| 254 | + AsyncScanCommands, "execute_command", AsyncMock(return_value=(0, [])) |
257 | 255 | ) as mock_execute_command, mock.patch.object(uuid, "uuid4", return_value="uuid"):
|
258 | 256 | [a async for a in AsyncScanCommands().scan_iter()]
|
259 |
| - mock_execute_command.assert_called_with('SCAN', '0', _iter_req_id="uuid") |
| 257 | + mock_execute_command.assert_called_with("SCAN", "0", _iter_req_id="uuid") |
260 | 258 | [a async for a in AsyncScanCommands().sscan_iter("")]
|
261 |
| - mock_execute_command.assert_called_with('SSCAN', '', '0', _iter_req_id="uuid") |
| 259 | + mock_execute_command.assert_called_with("SSCAN", "", "0", _iter_req_id="uuid") |
262 | 260 | with mock.patch.object(
|
263 |
| - AsyncScanCommands, |
264 |
| - "execute_command", |
265 |
| - AsyncMock(return_value=(0, {})) |
| 261 | + AsyncScanCommands, "execute_command", AsyncMock(return_value=(0, {})) |
266 | 262 | ) as mock_execute_command, mock.patch.object(uuid, "uuid4", return_value="uuid"):
|
267 | 263 | [a async for a in AsyncScanCommands().hscan_iter("")]
|
268 |
| - mock_execute_command.assert_called_with('HSCAN', '', '0', no_values=None, _iter_req_id="uuid") |
| 264 | + mock_execute_command.assert_called_with( |
| 265 | + "HSCAN", "", "0", no_values=None, _iter_req_id="uuid" |
| 266 | + ) |
269 | 267 | [a async for a in AsyncScanCommands().zscan_iter("")]
|
270 |
| - mock_execute_command.assert_called_with('ZSCAN', '', '0', score_cast_func=ANY, _iter_req_id="uuid") |
| 268 | + mock_execute_command.assert_called_with( |
| 269 | + "ZSCAN", "", "0", score_cast_func=ANY, _iter_req_id="uuid" |
| 270 | + ) |
0 commit comments