Example #1
0
 def test_no_smaller_than_second(self):
     with pytest.raises(Exception) as ex:
         utils.parse_timing("5s3", 0)
     assert str(ex.value) == "No unit smaller than second"
Example #2
0
 def test_no_last_minute(self):
     assert utils.parse_timing('1h2', 0) == 3720
Example #3
0
 def test_wrong_order(self):
     with pytest.raises(Exception) as ex:
         utils.parse_timing("1s3m5h", 0)
     assert str(ex.value) == "Unknown unit or wrong unit order"
Example #4
0
 def test_second(self):
     assert utils.parse_timing('3s', 0) == 3
Example #5
0
 def test_no_last_second(self):
     assert utils.parse_timing('1h2m3', 0) == 3723
Example #6
0
 def test_minute_second(self):
     assert utils.parse_timing('2m3s', 0) == 123
Example #7
0
 def test_minute(self):
     assert utils.parse_timing('2m', 0) == 120
Example #8
0
 def test_hour_second(self):
     assert utils.parse_timing('1h3s', 0) == 3603
Example #9
0
 def test_hour(self):
     assert utils.parse_timing('1h', 0) == 3600
Example #10
0
 def test_hour_minute(self):
     assert utils.parse_timing('1h2m', 0) == 3720
Example #11
0
 def test_hour_minute_second(self):
     assert utils.parse_timing('1h2m3s', 0) == 3723
Example #12
0
 def test_no_add(self):
     assert utils.parse_timing('10', 10) == 10
Example #13
0
 def test_add(self):
     assert utils.parse_timing('+10', 10) == 20
Example #14
0
 def test_digit(self):
     assert utils.parse_timing('10', 0) == 10