Skip to content

Commit 56a4ace

Browse files
committed
test(s3): cover async aget_entry_by_key path in S3 core
1 parent e793dda commit 56a4ace

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/s3_tests/test_s3_core.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,23 @@ async def _cached(x):
213213
assert call_count[0] == 1
214214

215215

216+
@pytest.mark.s3
217+
@pytest.mark.asyncio
218+
async def test_s3_core_async_get_entry_by_key_missing(s3_bucket):
219+
"""aget_entry_by_key delegates correctly and returns missing entries as None."""
220+
skip_if_missing()
221+
core = _make_core(s3_bucket=s3_bucket)
222+
223+
def _dummy(x):
224+
return x
225+
226+
core.set_func(_dummy)
227+
key = core.get_key((), {"x": 123})
228+
returned_key, entry = await core.aget_entry_by_key(key)
229+
assert returned_key == key
230+
assert entry is None
231+
232+
216233
@pytest.mark.s3
217234
def test_s3_core_none_not_cached_without_allow_none(s3_bucket):
218235
"""None results are NOT cached when allow_none=False (default)."""

0 commit comments

Comments
 (0)