#38 - Adding support to milliseconds and different units for latency and changing http status to a range, instead of a single value.

This commit is contained in:
Mitsuo Takaki
2018-03-18 16:58:02 -07:00
parent 726f5377b1
commit 1899e95642
8 changed files with 86 additions and 14 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env python
import unittest
from cachet_url_monitor.latency_unit import convert_to_unit
class ConfigurationTest(unittest.TestCase):
def test_convert_to_unit_ms(self):
assert convert_to_unit("ms", 1) == 1000
def test_convert_to_unit_s(self):
assert convert_to_unit("s", 20) == 20
def test_convert_to_unit_m(self):
assert convert_to_unit("m", 3) == float(3) / 60
def test_convert_to_unit_h(self):
assert convert_to_unit("h", 7200) == 2