mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 15:23:51 +00:00
added tests for all methods
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
parent
bc5a214c20
commit
52a9f53590
2 changed files with 3 additions and 3 deletions
|
@ -430,7 +430,6 @@ class MilvusVectorIOAdapter(OpenAIVectorStoreMixin, VectorIO, VectorDBsProtocolP
|
||||||
logger.error(f"Error loading openai vector store file contents for {file_id} in store {store_id}: {e}")
|
logger.error(f"Error loading openai vector store file contents for {file_id} in store {store_id}: {e}")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
async def _delete_openai_vector_store_file_from_storage(self, store_id: str, file_id: str) -> None:
|
async def _delete_openai_vector_store_file_from_storage(self, store_id: str, file_id: str) -> None:
|
||||||
"""Delete vector store file metadata from Milvus database."""
|
"""Delete vector store file metadata from Milvus database."""
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -336,6 +336,7 @@ async def test_save_openai_vector_store_file(milvus_vec_adapter, tmp_path_factor
|
||||||
# validating we don't raise an exception
|
# validating we don't raise an exception
|
||||||
await milvus_vec_adapter._save_openai_vector_store_file(store_id, file_id, file_info, file_contents)
|
await milvus_vec_adapter._save_openai_vector_store_file(store_id, file_id, file_info, file_contents)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_update_openai_vector_store_file(milvus_vec_adapter, tmp_path_factory):
|
async def test_update_openai_vector_store_file(milvus_vec_adapter, tmp_path_factory):
|
||||||
store_id = "vs_1234"
|
store_id = "vs_1234"
|
||||||
|
@ -359,7 +360,6 @@ async def test_update_openai_vector_store_file(milvus_vec_adapter, tmp_path_fact
|
||||||
updated_file_info = file_info.copy()
|
updated_file_info = file_info.copy()
|
||||||
updated_file_info["filename"] = "updated_test_file.txt"
|
updated_file_info["filename"] = "updated_test_file.txt"
|
||||||
|
|
||||||
|
|
||||||
await milvus_vec_adapter._update_openai_vector_store_file(
|
await milvus_vec_adapter._update_openai_vector_store_file(
|
||||||
store_id,
|
store_id,
|
||||||
file_id,
|
file_id,
|
||||||
|
@ -370,6 +370,7 @@ async def test_update_openai_vector_store_file(milvus_vec_adapter, tmp_path_fact
|
||||||
assert loaded_contents == updated_file_info
|
assert loaded_contents == updated_file_info
|
||||||
assert loaded_contents != file_info
|
assert loaded_contents != file_info
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_load_openai_vector_store_file_contents(milvus_vec_adapter, tmp_path_factory):
|
async def test_load_openai_vector_store_file_contents(milvus_vec_adapter, tmp_path_factory):
|
||||||
store_id = "vs_1234"
|
store_id = "vs_1234"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue