reindent for tests
This commit is contained in:
parent
0a26445778
commit
14e97f1be3
29
papi/main.py
29
papi/main.py
|
@ -217,22 +217,29 @@ def post_sonde_error(
|
|||
db: Session = Depends(get_db),
|
||||
):
|
||||
if not (sonde := crud.get_sonde(db, idsonde)):
|
||||
return # pragma: no cover
|
||||
Notifier.error_sonde(idsonde)
|
||||
if idsonde != "test":
|
||||
return # pragma: no cover
|
||||
|
||||
Notifier.error_sonde(idsonde, body["msg"])
|
||||
|
||||
# create fake sample
|
||||
last = list(crud.get_mesure(db, sonde.sonde_id, only_last=1))[0]
|
||||
from copy import copy
|
||||
try:
|
||||
last = list(crud.get_mesure(db, sonde.sonde_id, only_last=1))[0]
|
||||
except IndexError:
|
||||
pass
|
||||
else:
|
||||
from copy import copy
|
||||
|
||||
api_error = copy(last.content)
|
||||
from datetime import datetime
|
||||
api_error = copy(last.content)
|
||||
from datetime import datetime
|
||||
|
||||
date = str(datetime.now())
|
||||
for channel in api_error["channels"]:
|
||||
channel["status"] = "perte contact api"
|
||||
date = str(datetime.now())
|
||||
for channel in api_error["channels"]:
|
||||
channel["status"] = "perte contact api"
|
||||
|
||||
api_error["date"] = date
|
||||
api_error["date"] = date
|
||||
|
||||
post_sonde_data(request, idsonde, body=api_error, db=db)
|
||||
post_sonde_data(request, idsonde, body=api_error, db=db)
|
||||
return
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue