/
M1nX
/
SE_FastAPI_Example
Обзор
Документация
Войти
/
M1nX
/
SE_FastAPI_Example
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
tests/test_routes.py
18 строк
555 B
Evgeniy Rudenko
feat: added tests
11 май 2026, 18:36
11 май 2026, 18:36
9faef64
Код
Авторство
О чём код?
def test_root(client): response = client.get("/") assert response.status_code == 200 assert response.json() == {"message": "FastAPI service started"} def test_predict(client): response = client.post("/predict/", json={"text": "тест"}) assert response.status_code == 200 data = response.json() assert isinstance(data, list) assert data[0]["label"] == "POSITIVE" def test_analyze(client): response = client.get("/analyze/hello") assert response.status_code == 200 assert isinstance(response.json(), list)