Add notification route listing for probes

This commit is contained in:
Colin Goutte 2021-09-27 16:48:27 +02:00
parent 7571e2578d
commit 9f80bfca2e
2 changed files with 6 additions and 1 deletions

View File

@ -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:

View File

@ -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