28 lines
746 B
Python
28 lines
746 B
Python
|
import pytest
|
||
|
from fastapi.testclient import TestClient
|
||
|
|
||
|
from main import app
|
||
|
|
||
|
client = TestClient(app)
|
||
|
|
||
|
|
||
|
@pytest.mark.vcr()
|
||
|
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": ["15 min", "40 min"],
|
||
|
"destination": {"id": 46644, "name": "Charpennes"},
|
||
|
},
|
||
|
],
|
||
|
"stop": {"id": 290, "name": "Buers - Salengro"},
|
||
|
}
|