mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-16 22:09:27 +00:00
One more attempt with Claude's help to close connections
This commit is contained in:
parent
fa100c77fd
commit
a424815804
16 changed files with 132 additions and 38 deletions
|
|
@ -89,6 +89,8 @@ async def test_inference_store_pagination_basic():
|
|||
assert result3.data[0].id == "zebra-task"
|
||||
assert result3.has_more is False
|
||||
|
||||
await store.sql_store.close()
|
||||
|
||||
|
||||
async def test_inference_store_pagination_ascending():
|
||||
"""Test pagination with ascending order."""
|
||||
|
|
@ -126,6 +128,8 @@ async def test_inference_store_pagination_ascending():
|
|||
assert result2.data[0].id == "charlie-task"
|
||||
assert result2.has_more is True
|
||||
|
||||
await store.sql_store.close()
|
||||
|
||||
|
||||
async def test_inference_store_pagination_with_model_filter():
|
||||
"""Test pagination combined with model filtering."""
|
||||
|
|
@ -166,6 +170,8 @@ async def test_inference_store_pagination_with_model_filter():
|
|||
assert result2.data[0].model == "model-a"
|
||||
assert result2.has_more is False
|
||||
|
||||
await store.sql_store.close()
|
||||
|
||||
|
||||
async def test_inference_store_pagination_invalid_after():
|
||||
"""Test error handling for invalid 'after' parameter."""
|
||||
|
|
@ -178,6 +184,8 @@ async def test_inference_store_pagination_invalid_after():
|
|||
with pytest.raises(ValueError, match="Record with id='non-existent' not found in table 'chat_completions'"):
|
||||
await store.list_chat_completions(after="non-existent", limit=2)
|
||||
|
||||
await store.sql_store.close()
|
||||
|
||||
|
||||
async def test_inference_store_pagination_no_limit():
|
||||
"""Test pagination behavior when no limit is specified."""
|
||||
|
|
@ -208,3 +216,5 @@ async def test_inference_store_pagination_no_limit():
|
|||
assert result.data[0].id == "beta-second" # Most recent first
|
||||
assert result.data[1].id == "omega-first"
|
||||
assert result.has_more is False
|
||||
|
||||
await store.sql_store.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue