Fixing push status that has been broken since moving to a client (#80)

* Fixing push status that has been broken since moving to a client

* Adding unit test to cover the bug
This commit is contained in:
mtakaki
2020-01-28 01:42:49 -08:00
committed by GitHub
parent 79a9a7f8d6
commit df2d094dc6
6 changed files with 99 additions and 66 deletions

View File

@@ -1,10 +1,11 @@
#!/usr/bin/env python
from typing import Dict
seconds_per_unit = {"ms": 1000, "milliseconds": 1000, "s": 1, "seconds": 1, "m": float(1) / 60,
seconds_per_unit: Dict[str, float] = {"ms": 1000, "milliseconds": 1000, "s": 1, "seconds": 1, "m": float(1) / 60,
"minutes": float(1) / 60, "h": float(1) / 3600, "hours": float(1) / 3600}
def convert_to_unit(time_unit, value):
def convert_to_unit(time_unit: str, value: float):
"""
Will convert the given value from seconds to the given time_unit.