Ejemplo n.º 1
0
 def test_good_002(self):
     """ must validate few types """
     x = AnyOf(10, "bar")
     self.assertTrue(x.validate("bar"))
Ejemplo n.º 2
0
 def test_bad_001(self):
     """ must invalidate wrong types """
     x = AnyOf(int)
     self.assertFalse(x.validate("foo"))
Ejemplo n.º 3
0
 def test_good_001(self):
     """ must validate one type """
     x = AnyOf(int)
     self.assertTrue(x.validate(10))