/
ruslanf
/
table_reservation_api
Обзор
Документация
Войти
/
ruslanf
/
table_reservation_api
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/test_app.py
17 строк
388 B
Ruslan
pytest
23 апр 2025, 12:53
23 апр 2025, 12:53
9d62bf5
Код
Авторство
О чём код?
from fastapi.testclient import TestClient from main import app client = TestClient(app) def test_read_table(): response = client.get("/tables/") assert response.status_code == 200 def test_create_table(): data = { "name": "string", "seats": 10, "location": "string" } response = client.post('/tables/', json=data) assert response.status_code == 422