Exemple #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"
Exemple #2
0
 def test_no_last_minute(self):
     assert utils.parse_timing('1h2', 0) == 3720
Exemple #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"
Exemple #4
0
 def test_second(self):
     assert utils.parse_timing('3s', 0) == 3
Exemple #5
0
 def test_no_last_second(self):
     assert utils.parse_timing('1h2m3', 0) == 3723
Exemple #6
0
 def test_minute_second(self):
     assert utils.parse_timing('2m3s', 0) == 123
Exemple #7
0
 def test_minute(self):
     assert utils.parse_timing('2m', 0) == 120
Exemple #8
0
 def test_hour_second(self):
     assert utils.parse_timing('1h3s', 0) == 3603
Exemple #9
0
 def test_hour(self):
     assert utils.parse_timing('1h', 0) == 3600
Exemple #10
0
 def test_hour_minute(self):
     assert utils.parse_timing('1h2m', 0) == 3720
Exemple #11
0
 def test_hour_minute_second(self):
     assert utils.parse_timing('1h2m3s', 0) == 3723
Exemple #12
0
 def test_no_add(self):
     assert utils.parse_timing('10', 10) == 10
Exemple #13
0
 def test_add(self):
     assert utils.parse_timing('+10', 10) == 20
Exemple #14
0
 def test_digit(self):
     assert utils.parse_timing('10', 0) == 10