mirror of
https://github.com/Azure-Samples/graphrag-accelerator.git
synced 2025-06-27 04:39:57 +00:00
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
![]() |
# Copyright (c) Microsoft Corporation.
|
||
|
# Licensed under the MIT License.
|
||
|
"""
|
||
|
Integration tests for the /index API endpoints.
|
||
|
"""
|
||
|
|
||
|
from azure.cosmos import CosmosClient
|
||
|
|
||
|
|
||
|
def test_get_list_of_index_containers_empty(client, cosmos_client: CosmosClient):
|
||
|
"""Test getting a list of all blob containers holding an index."""
|
||
|
response = client.get("/index")
|
||
|
assert response.status_code == 200
|
||
|
|
||
|
|
||
|
def test_schedule_index_without_data(client, cosmos_client: CosmosClient):
|
||
|
"""Test scheduling an index job with a non-existent data blob container."""
|
||
|
response = client.post(
|
||
|
"/index",
|
||
|
params={"index_name": "myindex", "storage_name": "nonexistent-data-container"},
|
||
|
)
|
||
|
assert response.status_code == 500
|
||
|
|
||
|
|
||
|
# def test_schedule_index_with_data(client, cosmos_client, blob_with_data_container_name):
|
||
|
# """Test scheduling an index job with real data."""
|
||
|
# response = client.post("/index", files=None, params={"storage_name": blob_with_data_container_name, "index_name": "myindex"})
|
||
|
# print(response.json())
|
||
|
# assert response.status_code == 200
|