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