Test routing ok
This commit is contained in:
parent
e09f161b97
commit
adb69278c8
|
@ -72,11 +72,16 @@ def list_sonde():
|
|||
return [x for x in sondes.values()]
|
||||
|
||||
|
||||
@app.get("/notifications/{idsonde}/")
|
||||
@app.get("/notifications/{idsonde}")
|
||||
def list_notification(idsonde: str):
|
||||
return notifications[idsonde][::-1]
|
||||
|
||||
|
||||
@app.get("/notifications/{idsonde}/text")
|
||||
def list_notification_as_text(idsonde: str):
|
||||
return "Contenu"
|
||||
|
||||
|
||||
@app.post("/sonde/{idsonde}/")
|
||||
def post_sonde_data(
|
||||
idsonde: str, body: dict = Body(...), db: Session = Depends(get_db)
|
||||
|
|
|
@ -149,10 +149,11 @@ def test_onchange_notification():
|
|||
|
||||
|
||||
def test_template_rendering():
|
||||
id_sonde = "masonde_histo"
|
||||
notifs_text = client.get(f"/notifications/{idsonde}.txt")
|
||||
idsonde = "masonde_histo"
|
||||
notifs_text = client.get(f"/notifications/{idsonde}/text")
|
||||
assert notifs_text.ok
|
||||
# assert something in notif_text.body ?
|
||||
content = notifs_text
|
||||
assert "contenu" in content.text.lower()
|
||||
|
||||
|
||||
class CodeCoverageTestCase(TestCase):
|
||||
|
|
Loading…
Reference in New Issue