Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apps/ai_agent/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ dependencies = [
"openai>=1.0.0",
"weaviate-client>=4.0.0",
]

[dependency-groups]
dev = [
"pytest>=8.0.0",
"httpx>=0.27.0",
]

[tool.pytest.ini_options]
pythonpath = ["."]
Empty file added apps/ai_agent/tests/__init__.py
Empty file.
22 changes: 22 additions & 0 deletions apps/ai_agent/tests/test_health.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from fastapi.testclient import TestClient

from main import app

client = TestClient(app)


def test_health_returns_200():
response = client.get("/health")
assert response.status_code == 200


def test_health_response_body():
response = client.get("/health")
assert response.json() == {"status": "ok"}


def test_health_works_without_api_key(monkeypatch):
monkeypatch.delenv("OPENAI_API_KEY", raising=False)
response = client.get("/health")
assert response.status_code == 200
assert response.json() == {"status": "ok"}