Merge branch 'bugfix/display/remove_shebangs' into templating
This commit is contained in:
commit
fde0703621
|
@ -79,7 +79,9 @@ def list_notification(idsonde: str):
|
|||
|
||||
@app.get("/notifications/{idsonde}/text")
|
||||
def list_notification_as_text(idsonde: str):
|
||||
return "Contenu"
|
||||
content = notifications[idsonde][-1]
|
||||
|
||||
return
|
||||
|
||||
|
||||
@app.post("/sonde/{idsonde}/")
|
||||
|
@ -127,10 +129,11 @@ def get_rapport(idsonde):
|
|||
else:
|
||||
last = last.content
|
||||
last = utils.prepare(last)
|
||||
|
||||
for name, data in sorted(
|
||||
last["channels"].items(), key=lambda text: float(text[0].split("#")[0])
|
||||
):
|
||||
yield f'{name} {data["status"]}'
|
||||
yield f'{name.split("#", 1)[1]} {data["status"]}'
|
||||
|
||||
|
||||
@app.get("/sonde/{idsonde}/historique")
|
||||
|
|
|
@ -62,7 +62,7 @@ def test_sample_report():
|
|||
report = client.get(f"/sonde/{id_}/rapport")
|
||||
rjson = report.json()
|
||||
assert len(rjson) == 1
|
||||
assert rjson[0] == "-1#Test channel ok"
|
||||
assert rjson[0] == "Test channel ok"
|
||||
|
||||
data["channels"][0]["status"] = "error"
|
||||
response = client.post(f"/sonde/{id_}/", json=data)
|
||||
|
@ -70,7 +70,7 @@ def test_sample_report():
|
|||
report = client.get(f"/sonde/{id_}/rapport")
|
||||
rjson = report.json()
|
||||
assert len(rjson) == 1
|
||||
assert rjson[0] == "-1#Test channel error"
|
||||
assert rjson[0] == "Test channel error"
|
||||
|
||||
|
||||
def test_historique():
|
||||
|
|
Loading…
Reference in New Issue