예제 #1
0
class test_OnOffVar(unittest.TestCase):
    """ verify functionality of the OnOffVar variable class
    """
    def setUp(self):
        self.ovar = OnOffVar('name', 'description')

    def testValidation(self):
        """ check to see that various inputs result in a Boolean Value
        """
        for val in ('f', 'F', 'n', 'N', 'false', 0, 'off'):
            self.assertEqual(self.ovar.validate(val), 'off')

        for val in ('t', 'T', 'y', 'Y', 'true', 1, 'on'):
            self.assertEqual(self.ovar.validate(val), 'on')

        self.assertRaises(ValidationException, self.ovar.validate, 'lunchbox')
예제 #2
0
파일: test_vars.py 프로젝트: Vinsurya/Plone
class test_OnOffVar(unittest.TestCase):
    """ verify functionality of the OnOffVar variable class
    """

    def setUp(self):
        self.ovar = OnOffVar('name', 'description')

    def testValidation(self):
        """ check to see that various inputs result in a Boolean Value
        """
        for val in ('f', 'F', 'n', 'N', 'false', 0, 'off'):
            self.assertEqual(self.ovar.validate(val), 'off')

        for val in ('t', 'T', 'y', 'Y', 'true', 1, 'on'):
            self.assertEqual(self.ovar.validate(val), 'on')

        self.assertRaises(ValidationException, self.ovar.validate, 'lunchbox')
예제 #3
0
파일: test_vars.py 프로젝트: Vinsurya/Plone
 def setUp(self):
     self.ovar = OnOffVar('name', 'description')
예제 #4
0
 def setUp(self):
     self.ovar = OnOffVar('name', 'description')