mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-28 04:41:58 +00:00
wip
This commit is contained in:
parent
749cbcca31
commit
1afd33c21e
10 changed files with 509 additions and 59 deletions
|
|
@ -1,7 +1,17 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
from collections.abc import AsyncGenerator
|
||||
|
||||
import pytest
|
||||
|
||||
from llama_stack.providers.remote.files.object.s3.config import S3FilesImplConfig
|
||||
from llama_stack.providers.remote.files.object.s3.s3_files import S3FilesAdapter
|
||||
from llama_stack.providers.utils.kvstore import KVStore, kvstore_impl
|
||||
from llama_stack.providers.utils.kvstore.config import SqliteKVStoreConfig
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
@ -15,8 +25,22 @@ def s3_config():
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
async def s3_files(s3_config):
|
||||
adapter = S3FilesAdapter(s3_config)
|
||||
async def kvstore() -> AsyncGenerator[KVStore, None]:
|
||||
"""Create a SQLite KV store for testing."""
|
||||
config = SqliteKVStoreConfig(
|
||||
path=":memory:" # Use in-memory SQLite for tests
|
||||
)
|
||||
store = await kvstore_impl(config)
|
||||
await store.initialize()
|
||||
yield store
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def s3_files(s3_config, kvstore):
|
||||
adapter = S3FilesAdapter(
|
||||
s3_config,
|
||||
kvstore,
|
||||
)
|
||||
await adapter.initialize()
|
||||
return adapter
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue