diff --git a/papi/main.py b/papi/main.py index c69b432..20b08b5 100644 --- a/papi/main.py +++ b/papi/main.py @@ -43,6 +43,11 @@ def list_sonde(): return [x for x in sondes.values()] +@app.get("/notifications/{idsonde}/") +def list_notification(idsonde: str): + return [notifications[idsonde][::-1]] + + @app.post("/sonde/{idsonde}/") def post_sonde_data(idsonde: str, body: dict = Body(...)): if idsonde not in sondes: diff --git a/tests/test_papi.py b/tests/test_papi.py index 9a3ad9a..10bce9f 100644 --- a/tests/test_papi.py +++ b/tests/test_papi.py @@ -141,7 +141,7 @@ def test_onchange_notification(): jresp = response.json() assert not jresp["notify"] - notifs = client.get(f"notifications/{id_sonde}/") + notifs = client.get(f"/notifications/{id_sonde}/") assert notifs.ok assert len(notifs) == 1