mirror of
https://github.com/mtan93/cachet-url-monitor.git
synced 2026-03-08 05:31:58 +00:00
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:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user