feat: Add NaliiaBot API
This commit is contained in:
27
tests/test_api.py
Normal file
27
tests/test_api.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
from src.naliiabotapi.main import app
|
||||
from langchain_core.messages import HumanMessage
|
||||
|
||||
|
||||
@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
|
||||
Reference in New Issue
Block a user