/
iamstacyok
/
SE_FastAPI_Example
Обзор
Документация
Войти
/
iamstacyok
/
SE_FastAPI_Example
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
1
CI/CD
Аналитика
Безопасность
main
tests/test_main.py
20 строк
462 B
KateBel
create: test_main.py
11 май 2026, 20:35
Верифицирован
11 май 2026, 20:35
1251b26
Код
Авторство
О чём код?
from fastapi.testclient import TestClient from main import app client = TestClient(app) def test_root_returns_start_message(): response = client.get("/") assert response.status_code == 200 assert response.json() == {"message": "Sentiment Analysis API started!"} def test_health_check_returns_ok(): response = client.get("/health") assert response.status_code == 200 assert response.json() == {"status": "ok"}