diff --git a/papi/main.py b/papi/main.py index 20b08b5..a647e07 100644 --- a/papi/main.py +++ b/papi/main.py @@ -11,6 +11,7 @@ app = FastAPI() mesures = defaultdict(list) +notifications = defaultdict(list) class Sonde(BaseModel): @@ -45,7 +46,7 @@ def list_sonde(): @app.get("/notifications/{idsonde}/") def list_notification(idsonde: str): - return [notifications[idsonde][::-1]] + return notifications[idsonde][::-1] @app.post("/sonde/{idsonde}/") diff --git a/tests/test_papi.py b/tests/test_papi.py index 10bce9f..767dd55 100644 --- a/tests/test_papi.py +++ b/tests/test_papi.py @@ -143,7 +143,7 @@ def test_onchange_notification(): notifs = client.get(f"/notifications/{id_sonde}/") assert notifs.ok - assert len(notifs) == 1 + assert len(notifs.json()) == 1 class CodeCoverageTestCase(TestCase):