Files
NaliiaBot/tests/test_api.py
2026-03-04 16:20:56 -05:00

30 lines
556 B
Python

import pytest
from fastapi.testclient import TestClient
from src.naliiabotapi.main import app
@pytest.fixture
def client():
client = TestClient(app)
return client
def test_root(client):
response = client.get("/")
assert response.status_code == 200
def test_health(client):
response = client.get("/health")
assert response.status_code == 200
def test_chat(client):
response = client.post("/chat", json={"messages": "Hello, how are you?"})
assert response.status_code == 200
assert response.json() is not None