mirror of
https://github.com/mtan93/cachet-url-monitor.git
synced 2026-03-08 05:31:58 +00:00
20 lines
393 B
Python
20 lines
393 B
Python
#!/usr/bin/env python
|
|
|
|
from cachet_url_monitor.latency_unit import convert_to_unit
|
|
|
|
|
|
def test_convert_to_unit_ms():
|
|
assert convert_to_unit("ms", 1) == 1000
|
|
|
|
|
|
def test_convert_to_unit_s():
|
|
assert convert_to_unit("s", 20) == 20
|
|
|
|
|
|
def test_convert_to_unit_m():
|
|
assert convert_to_unit("m", 3) == float(3) / 60
|
|
|
|
|
|
def test_convert_to_unit_h():
|
|
assert convert_to_unit("h", 7200) == 2
|