File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
packages/service-library/tests/redis Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 1+ # pylint:disable=unused-variable
2+ # pylint:disable=unused-argument
3+ # pylint:disable=redefined-outer-name
4+ # pylint:disable=protected-access
5+
16from servicelib .redis ._clients_manager import RedisClientsManager
27from servicelib .redis ._models import RedisManagerDBConfig
38from settings_library .redis import RedisDatabase , RedisSettings
49
10+ pytest_simcore_core_services_selection = [
11+ "redis" ,
12+ ]
13+ pytest_simcore_ops_services_selection = [
14+ "redis-commander" ,
15+ ]
16+
517
618async def test_redis_client_sdks_manager (
7- mock_redis_socket_timeout : None , redis_service : RedisSettings
19+ mock_redis_socket_timeout : None ,
20+ redis_service : RedisSettings ,
821):
922 all_redis_configs : set [RedisManagerDBConfig ] = {
1023 RedisManagerDBConfig (database = db ) for db in RedisDatabase
Original file line number Diff line number Diff line change 1+ # pylint:disable=unused-variable
2+ # pylint:disable=unused-argument
13# pylint:disable=redefined-outer-name
4+ # pylint:disable=protected-access
5+
26
37import asyncio
48import datetime
@@ -68,6 +72,15 @@ def sleep_duration(faker: Faker) -> float:
6872 return faker .pyfloat (positive = True , min_value = 0.2 , max_value = 0.8 )
6973
7074
75+ async def test_exclusive_with_empty_lock_key_raises (redis_client_sdk : RedisClientSDK ):
76+ @exclusive (redis_client_sdk , lock_key = "" )
77+ async def _ ():
78+ pass
79+
80+ with pytest .raises (ValueError , match = "lock_key cannot be empty" ):
81+ await _ ()
82+
83+
7184async def test_exclusive_decorator (
7285 get_redis_client_sdk : Callable [
7386 [RedisDatabase ], AbstractAsyncContextManager [RedisClientSDK ]
You can’t perform that action at this time.
0 commit comments