예제 #1
0
 def test_between_values(self):
     validator = Length(min=1, max=10)
     assert validator('Test')
예제 #2
0
 def test_invalid_min_greater_than_max(self):
     Length(min=10, max=9)
예제 #3
0
 def test_exact_value(self):
     validator = Length(min=4, max=4)
     assert validator('Test')
예제 #4
0
 def test_meets_max_requirement(self):
     validator = Length(max=10)
     assert validator('Test')
예제 #5
0
 def test_doesnt_meet_max_requirement(self):
     validator = Length(max=10)
     validator('This is a test')
예제 #6
0
 def test_meets_min_requirement(self):
     validator = Length(min=1)
     assert validator('Test')
예제 #7
0
 def test_doesnt_meet_min_requirement(self):
     validator = Length(min=10)
     validator('Test')