Exemple #1
0
 def test_val_in_list(self):
     cont = [1, 2, 3, 4]
     func = validators.one_of(cont)
     assert func(1) == 1
Exemple #2
0
 def test_val_not_in_list(self):
     cont = [1, 2, 3, 4]
     func = validators.one_of(cont)
     raises_Invalid(func)(5)
Exemple #3
0
 def test_empty_val_accepted(self):
     cont = [1, 2, 3, 4]
     func = validators.one_of(cont)
     assert func("") == ""