Exemplo n.º 1
0
 def test_parsing_one_digit_minute(self):
     self.assertEqual(3, utils.parse_duration_string("3m"))
Exemplo n.º 2
0
 def test_parsing_3_digit_minute(self):
     self.assertEqual(82, utils.parse_duration_string("82m"))
Exemplo n.º 3
0
 def test_doesnt_start_with_number(self):
     with self.assertRaises(SyntaxError):
         utils.parse_duration_string("1h m2")
Exemplo n.º 4
0
 def test_doesnt_have_time_unit(self):
     with self.assertRaises(SyntaxError):
         utils.parse_duration_string("1d 2 4m")
Exemplo n.º 5
0
 def test_all_together_unordered(self):
     self.assertEqual(15924, utils.parse_duration_string("1h 24m 1w 4d"))
Exemplo n.º 6
0
 def test_zero(self):
     self.assertEqual(0, utils.parse_duration_string("0h 0m"))
Exemplo n.º 7
0
 def test_parsing_3_digit_week(self):
     self.assertEqual(1239840, utils.parse_duration_string("123w"))
Exemplo n.º 8
0
 def test_all_together(self):
     self.assertEqual(24752, utils.parse_duration_string("2w 3d 4h 32m"))
Exemplo n.º 9
0
 def test_parsing_one_digit_week(self):
     self.assertEqual(30240, utils.parse_duration_string("3w"))
Exemplo n.º 10
0
 def test_parsing_3_digit_day(self):
     self.assertEqual(177120, utils.parse_duration_string("123d"))
Exemplo n.º 11
0
 def test_parsing_one_digit_day(self):
     self.assertEqual(4320, utils.parse_duration_string("3d"))
Exemplo n.º 12
0
 def test_parsing_3_digit_hour(self):
     self.assertEqual(7380, utils.parse_duration_string("123h"))
Exemplo n.º 13
0
 def test_parsing_one_digit_hour(self):
     self.assertEqual(180, utils.parse_duration_string("3h"))