Esempio n. 1
0
 def test_text(self):
     with self.assertRaises(ValidationError):
         validators.minute_validator('fsd')
     with self.assertRaises(ValidationError):
         validators.minute_validator('.')
     with self.assertRaises(ValidationError):
         validators.minute_validator('432a')
Esempio n. 2
0
 def test_bad_slice(self):
     with self.assertRaises(ValidationError):
         validators.minute_validator('*/100')
     with self.assertRaises(ValidationError):
         validators.minute_validator('10/30')
     with self.assertRaises(ValidationError):
         validators.minute_validator('10-20/100')
Esempio n. 3
0
 def test_out_range(self):
     with self.assertRaises(ValidationError):
         validators.minute_validator('0-432')
     with self.assertRaises(ValidationError):
         validators.minute_validator('342-432')
     with self.assertRaises(ValidationError):
         validators.minute_validator('4-60')
Esempio n. 4
0
 def test_out_range(self):
     with self.assertRaises(ValidationError):
         validators.minute_validator('0-432')
     with self.assertRaises(ValidationError):
         validators.minute_validator('342-432')
     with self.assertRaises(ValidationError):
         validators.minute_validator('4-60')
Esempio n. 5
0
 def test_big_number(self):
     with self.assertRaises(ValidationError):
         validators.minute_validator('60')
     with self.assertRaises(ValidationError):
         validators.minute_validator('420')
     with self.assertRaises(ValidationError):
         validators.minute_validator('100500')
Esempio n. 6
0
 def test_bad_slice(self):
     with self.assertRaises(ValidationError):
         validators.minute_validator('*/100')
     with self.assertRaises(ValidationError):
         validators.minute_validator('10/30')
     with self.assertRaises(ValidationError):
         validators.minute_validator('10-20/100')
Esempio n. 7
0
 def test_text(self):
     with self.assertRaises(ValidationError):
         validators.minute_validator('fsd')
     with self.assertRaises(ValidationError):
         validators.minute_validator('.')
     with self.assertRaises(ValidationError):
         validators.minute_validator('432a')
Esempio n. 8
0
 def test_big_number(self):
     with self.assertRaises(ValidationError):
         validators.minute_validator('60')
     with self.assertRaises(ValidationError):
         validators.minute_validator('420')
     with self.assertRaises(ValidationError):
         validators.minute_validator('100500')
Esempio n. 9
0
    def test_good(self):
        try:
            validators.minute_validator('*')
            validators.minute_validator('0')
            validators.minute_validator('1')
            validators.minute_validator('54')
            validators.minute_validator('59')

            validators.minute_validator('1,2,59')
            validators.minute_validator('43,2')
            validators.minute_validator('5,20,25,43')

            validators.minute_validator('1-4')
            validators.minute_validator('1-29')

            validators.minute_validator('45-59')
            validators.minute_validator('*/4')
            validators.minute_validator('*/43')
            validators.minute_validator('1-2/43')
        except ValidationError as e:
            self.fail(e)
Esempio n. 10
0
 def test_bad_range(self):
     with self.assertRaises(ValidationError):
         validators.minute_validator('10-4')
Esempio n. 11
0
 def test_space(self):
     with self.assertRaises(ValidationError):
         validators.minute_validator('1, 2')
Esempio n. 12
0
 def test_bad_range(self):
     with self.assertRaises(ValidationError):
         validators.minute_validator('10-4')
Esempio n. 13
0
 def test_space(self):
     with self.assertRaises(ValidationError):
         validators.minute_validator('1, 2')
Esempio n. 14
0
    def test_good(self):
        try:
            validators.minute_validator('*')
            validators.minute_validator('0')
            validators.minute_validator('1')
            validators.minute_validator('54')
            validators.minute_validator('59')

            validators.minute_validator('1,2,59')
            validators.minute_validator('43,2')
            validators.minute_validator('5,20,25,43')

            validators.minute_validator('1-4')
            validators.minute_validator('1-29')

            validators.minute_validator('45-59')
            validators.minute_validator('*/4')
            validators.minute_validator('*/43')
            validators.minute_validator('1-2/43')
        except ValidationError as e:
            self.fail(e)