langflow/tests/test_vectorstore_template.py
Gabriel Luiz Freitas Almeida 812864eded 🔧 fix(test_agents_template.py): update test functions to include logged_in_headers parameter to test authenticated requests
🔧 fix(test_chains_template.py): update test functions to include logged_in_headers parameter to test authenticated requests
🔧 fix(test_endpoints.py): update test_get_all function to include logged_in_headers parameter to test authenticated requests
🔧 fix(test_llms_template.py): update test functions to include logged_in_headers parameter to test authenticated requests
🔧 fix(test_prompts_template.py): update test functions to include logged_in_headers parameter to test authenticated requests
🔧 fix(test_vectorstore_template.py): update test functions to include logged_in_headers parameter to test authenticated requests
2023-08-25 16:30:01 -03:00

14 lines
612 B
Python

from fastapi.testclient import TestClient
from langflow.services.utils import get_settings_manager
# check that all agents are in settings.agents
# are in json_response["agents"]
def test_vectorstores_settings(client: TestClient, logged_in_headers):
settings_manager = get_settings_manager()
response = client.get("api/v1/all", headers=logged_in_headers)
assert response.status_code == 200
json_response = response.json()
vectorstores = json_response["vectorstores"]
settings_vecs = set(settings_manager.settings.VECTORSTORES)
assert all(vs in vectorstores for vs in settings_vecs)