Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit fbbad71

Browse files
committed
add new pytests
1 parent 0252646 commit fbbad71

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
"""
4+
Integration tests for the /index/config API endpoints.
5+
"""
6+
7+
from unittest.mock import AsyncMock, patch
8+
9+
import pytest_asyncio
10+
11+
12+
@pytest_asyncio.fixture
13+
def mock_generate_indexing_prompts():
14+
with patch(
15+
"graphrag.api.generate_indexing_prompts", new_callable=AsyncMock
16+
) as mock:
17+
mock.return_value = (
18+
"synthetic-prompt1",
19+
"synthetic-prompt2",
20+
"synthetic-prompt3",
21+
)
22+
yield mock
23+
24+
25+
def test_generate_prompts(
26+
blob_with_data_container_name, mock_generate_indexing_prompts, client
27+
):
28+
"""Test generating prompts."""
29+
response = client.get(
30+
"/index/config/prompts",
31+
params={"storage_name": blob_with_data_container_name},
32+
)
33+
assert response.status_code == 200

0 commit comments

Comments
 (0)