@@ -0,0 +1,1637 @@
+# -*- coding: utf-8 -*-%0A%0Aimport unittest%0A%0Afrom formencode import compound, Invalid%0Afrom formencode.validators import DictConverter%0A%0A%0Aclass TestAllCompoundValidator(unittest.TestCase):%0A%0A    def setUp(self):%0A        self.validator = compound.All(%0A            validators=%5BDictConverter(%7B2:1%7D), DictConverter(%7B3:2%7D)%5D)%0A%0A    def test_to_python(self):%0A        self.assertEqual(self.validator.to_python(3), 1)%0A%0A    def test_from_python(self):%0A        self.assertEqual(self.validator.from_python(1), 3)%0A%0A%0Aclass TestAnyCompoundValidator(unittest.TestCase):%0A%0A    def setUp(self):%0A        self.validator = compound.Any(%0A            validators=%5BDictConverter(%7B2:'c'%7D), DictConverter(%7B2:'b'%7D), DictConverter(%7B1:'b'%7D)%5D)%0A%0A    def test_to_python(self):%0A        # Should stop before 'c' coming from the right.%0A        self.assertEqual(self.validator.to_python(2), 'b')%0A%0A    def test_from_python(self):%0A        # Should stop before 1 coming from the left.%0A        self.assertEqual(self.validator.from_python('b'), 2)%0A%0A    def test_to_python_error(self):%0A        try:%0A            self.validator.to_python(3)%0A        except Invalid, e:%0A            self.failUnless('Enter a value from: 2' in str(e))%0A        else:%0A            self.fail('Invalid should be raised when no validator succeeds.')%0A%0A%0Aclass TestPipeCompoundValidator(unittest.TestCase):%0A%0A    def setUp(self):%0A        self.validator = compound.Pipe(%0A            validators=%5BDictConverter(%7B1: 2%7D), DictConverter(%7B2: 3%7D)%5D)%0A%0A    def test_to_python(self):%0A        self.assertEqual(self.validator.to_python(1), 3)%0A%0A    def test_from_python(self):%0A        self.assertEqual(self.validator.from_python(3), 1)%0A

Add some basic tests for compound validators which can be expanded upon later.