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