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