Be more conservative with delays

master
Gabriel Augendre 8 months ago
parent 81b2b8961e
commit 5f11ae32e5
  1. 3
      main.py
  2. 2
      tests/test_main.py

@ -114,9 +114,6 @@ def get_delai(heure_passage: str) -> str:
now = datetime.now()
delai = dt - now
minutes = delai.seconds // 60
seconds = delai.seconds % 60
if seconds > 30:
minutes += 1
if minutes <= 0:
return "Proche"
return f"{minutes} min"

@ -21,7 +21,7 @@ def test_get_stop():
},
{
"ligne": "C17",
"delais": ["15 min", "40 min"],
"delais": ["14 min", "39 min"],
"destination": {"id": 46644, "name": "Charpennes"},
},
],

Loading…
Cancel
Save