mirror of
https://github.com/Azure-Samples/graphrag-accelerator.git
synced 2026-01-06 12:22:57 +00:00
add new pytests
This commit is contained in:
parent
0252646d16
commit
fbbad71d0b
33
backend/tests/integration/test_api_index_configuration.py
Normal file
33
backend/tests/integration/test_api_index_configuration.py
Normal file
@ -0,0 +1,33 @@
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
"""
|
||||
Integration tests for the /index/config API endpoints.
|
||||
"""
|
||||
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest_asyncio
|
||||
|
||||
|
||||
@pytest_asyncio.fixture
|
||||
def mock_generate_indexing_prompts():
|
||||
with patch(
|
||||
"graphrag.api.generate_indexing_prompts", new_callable=AsyncMock
|
||||
) as mock:
|
||||
mock.return_value = (
|
||||
"synthetic-prompt1",
|
||||
"synthetic-prompt2",
|
||||
"synthetic-prompt3",
|
||||
)
|
||||
yield mock
|
||||
|
||||
|
||||
def test_generate_prompts(
|
||||
blob_with_data_container_name, mock_generate_indexing_prompts, client
|
||||
):
|
||||
"""Test generating prompts."""
|
||||
response = client.get(
|
||||
"/index/config/prompts",
|
||||
params={"storage_name": blob_with_data_container_name},
|
||||
)
|
||||
assert response.status_code == 200
|
||||
Loading…
x
Reference in New Issue
Block a user