Skip to content

Commit 7340aad

Browse files
committed
Codestyle changes
1 parent cdf8504 commit 7340aad

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

tests/test_connection.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,10 @@ def test_clears_cache_on_disconnect(self, mock_connection, cache_conf):
428428

429429
cache.set(
430430
CacheEntry(
431-
cache_key=cache_key, cache_value=b"bar", status=CacheEntryStatus.VALID,
432-
connection_ref=mock_connection
431+
cache_key=cache_key,
432+
cache_value=b"bar",
433+
status=CacheEntryStatus.VALID,
434+
connection_ref=mock_connection,
433435
)
434436
)
435437
assert cache.get(cache_key).cache_value == b"bar"
@@ -439,7 +441,9 @@ def test_clears_cache_on_disconnect(self, mock_connection, cache_conf):
439441
mock_connection.host = "mock"
440442
mock_connection.port = "mock"
441443

442-
proxy_connection = CacheProxyConnection(mock_connection, cache, threading.Lock())
444+
proxy_connection = CacheProxyConnection(
445+
mock_connection, cache, threading.Lock()
446+
)
443447
proxy_connection.disconnect()
444448

445449
assert len(cache.get_collection()) == 0
@@ -457,32 +461,34 @@ def test_read_response_returns_cached_reply(self, mock_cache, mock_connection):
457461
cache_key=CacheKey(command="GET", redis_keys=("foo",)),
458462
cache_value=CacheProxyConnection.DUMMY_CACHE_VALUE,
459463
status=CacheEntryStatus.IN_PROGRESS,
460-
connection_ref=mock_connection
464+
connection_ref=mock_connection,
461465
),
462466
CacheEntry(
463467
cache_key=CacheKey(command="GET", redis_keys=("foo",)),
464468
cache_value=b"bar",
465469
status=CacheEntryStatus.VALID,
466-
connection_ref=mock_connection
470+
connection_ref=mock_connection,
467471
),
468472
CacheEntry(
469473
cache_key=CacheKey(command="GET", redis_keys=("foo",)),
470474
cache_value=b"bar",
471475
status=CacheEntryStatus.VALID,
472-
connection_ref=mock_connection
476+
connection_ref=mock_connection,
473477
),
474478
CacheEntry(
475479
cache_key=CacheKey(command="GET", redis_keys=("foo",)),
476480
cache_value=b"bar",
477481
status=CacheEntryStatus.VALID,
478-
connection_ref=mock_connection
482+
connection_ref=mock_connection,
479483
),
480484
]
481485
mock_connection.send_command.return_value = Any
482486
mock_connection.read_response.return_value = b"bar"
483487
mock_connection.can_read.return_value = False
484488

485-
proxy_connection = CacheProxyConnection(mock_connection, mock_cache, threading.Lock())
489+
proxy_connection = CacheProxyConnection(
490+
mock_connection, mock_cache, threading.Lock()
491+
)
486492
proxy_connection.send_command(*["GET", "foo"], **{"keys": ["foo"]})
487493
assert proxy_connection.read_response() == b"bar"
488494
assert proxy_connection.read_response() == b"bar"
@@ -495,15 +501,15 @@ def test_read_response_returns_cached_reply(self, mock_cache, mock_connection):
495501
cache_key=CacheKey(command="GET", redis_keys=("foo",)),
496502
cache_value=CacheProxyConnection.DUMMY_CACHE_VALUE,
497503
status=CacheEntryStatus.IN_PROGRESS,
498-
connection_ref=mock_connection
504+
connection_ref=mock_connection,
499505
)
500506
),
501507
call(
502508
CacheEntry(
503509
cache_key=CacheKey(command="GET", redis_keys=("foo",)),
504510
cache_value=b"bar",
505511
status=CacheEntryStatus.VALID,
506-
connection_ref=mock_connection
512+
connection_ref=mock_connection,
507513
)
508514
),
509515
]

0 commit comments

Comments
 (0)