diff --git a/.github/test_app.py b/.github/test_app.py new file mode 100644 index 0000000..13e5f0e --- /dev/null +++ b/.github/test_app.py @@ -0,0 +1,23 @@ +from fastapi.testclient import TestClient +from app import app + +client = TestClient(app) + +def test_index(): + response = client.get("/") + assert response.status_code == 200 + assert "Welcome" in response.text + +def test_new_chat(): + response = client.post("/new-chat") + assert response.status_code == 200 + assert response.json() == {"status": "new chat started"} + +def test_pause(): + response = client.post("/pause") + assert response.status_code == 200 + assert response.json()["paused"] is True + + response = client.post("/pause") + assert response.status_code == 200 + assert response.json()["paused"] is False