@@ -58,6 +58,10 @@ def get_value_from_response(response: GetItemOutputTypeDef) -> dict[str, Any]:
5858 return json .loads (response .get ("Item" , {}).get ("value" , {}).get ("S" , {})) # pyright: ignore[reportArgumentType]
5959
6060
61+ def get_dynamo_client_from_store (store : DynamoDBStore ) -> DynamoDBClient :
62+ return store ._connected_client # pyright: ignore[reportPrivateUsage]
63+
64+
6165@pytest .mark .skipif (should_skip_docker_tests (), reason = "Docker is not available" )
6266class TestDynamoDBStore (ContextManagerStoreTestMixin , BaseStoreTests ):
6367 @pytest .fixture (autouse = True , scope = "session" , params = DYNAMODB_VERSIONS_TO_TEST )
@@ -108,18 +112,14 @@ async def store(self, setup_dynamodb: None) -> DynamoDBStore:
108112 async def dynamodb_store (self , store : DynamoDBStore ) -> DynamoDBStore :
109113 return store
110114
111- @pytest .fixture
112- async def dynamodb_client (self , store : DynamoDBStore ) -> DynamoDBClient :
113- return store ._connected_client # pyright: ignore[reportPrivateUsage]
114-
115115 @pytest .mark .skip (reason = "Distributed Caches are unbounded" )
116116 @override
117117 async def test_not_unbounded (self , store : BaseStore ): ...
118118
119- async def test_value_stored (self , store : DynamoDBStore , dynamodb_client : DynamoDBClient ):
119+ async def test_value_stored (self , store : DynamoDBStore ):
120120 await store .put (collection = "test" , key = "test_key" , value = {"name" : "Alice" , "age" : 30 })
121121
122- response = await dynamodb_client .get_item (
122+ response = await get_dynamo_client_from_store ( store = store ) .get_item (
123123 TableName = DYNAMODB_TEST_TABLE , Key = {"collection" : {"S" : "test" }, "key" : {"S" : "test_key" }}
124124 )
125125 assert get_value_from_response (response = response ) == snapshot (
@@ -128,7 +128,7 @@ async def test_value_stored(self, store: DynamoDBStore, dynamodb_client: DynamoD
128128
129129 await store .put (collection = "test" , key = "test_key" , value = {"name" : "Alice" , "age" : 30 }, ttl = 10 )
130130
131- response = await dynamodb_client .get_item (
131+ response = await get_dynamo_client_from_store ( store = store ) .get_item (
132132 TableName = DYNAMODB_TEST_TABLE , Key = {"collection" : {"S" : "test" }, "key" : {"S" : "test_key" }}
133133 )
134134 assert get_value_from_response (response = response ) == snapshot (
0 commit comments