This repository has been archived on 2024-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
tcl-filtrage/tests/test_main.py

30 lines
822 B
Python
Raw Normal View History

2021-12-04 15:57:16 +01:00
import freezegun as freezegun
2021-11-14 11:52:44 +01:00
import pytest
from fastapi.testclient import TestClient
from main import app
client = TestClient(app)
@pytest.mark.vcr()
2021-12-04 15:57:16 +01:00
@freezegun.freeze_time("2021-11-14 11:47:34")
2021-11-14 11:52:44 +01:00
def test_get_stop():
response = client.get("/stop/290", headers={"Authorization": "Basic token"})
assert response.status_code == 200
assert response.json() == {
"passages": [
{
"ligne": "37",
"delais": ["2 min", "33 min"],
"destination": {"id": 46642, "name": "Charpennes"},
},
{
"ligne": "C17",
2021-12-04 16:10:46 +01:00
"delais": ["14 min", "39 min"],
2021-11-14 11:52:44 +01:00
"destination": {"id": 46644, "name": "Charpennes"},
},
],
"stop": {"id": 290, "name": "Buers - Salengro"},
}