def interval(self, section: str, fallback='') -> int: age = self.parser.get(section, INTERVAL, fallback=fallback) return parse_hr_time(age)
def test_parse_time_h(self): self.assertEqual(48 * 60, parse_hr_time('48h'))
def test_parse_time_bad(self): self.assertTrue(parse_hr_time('321') < 0)
def test_parse_time_d(self): self.assertEqual(24 * 60 * 3, parse_hr_time('3d'))
def test_parse_time(self): self.assertEqual(123, parse_hr_time('123m'))