import freezegun as freezegun
import pytest
from fastapi.testclient import TestClient
from main import app
client = TestClient(app)
@pytest.mark.vcr()
@freezegun.freeze_time("2021-11-14 11:47:34")
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",
"delais": ["14 min", "39 min"],
"destination": {"id": 46644, "name": "Charpennes"},
],
"stop": {"id": 290, "name": "Buers - Salengro"},
}