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

    def testValidation(self):
        """ an IntVar should take values that can be cast to an integer,
            any other value should raise a ValidationException
        """
        self.assertEqual(1, self.ivar.validate(1))
        self.assertEqual(1, self.ivar.validate(1.9))
        self.assertEqual(1, self.ivar.validate('1'))

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

    def setUp(self):
        self.ivar = IntVar('name', 'description')

    def testValidation(self):
        """ an IntVar should take values that can be cast to an integer,
            any other value should raise a ValidationException
        """
        self.assertEqual(1, self.ivar.validate(1))
        self.assertEqual(1, self.ivar.validate(1.9))
        self.assertEqual(1, self.ivar.validate('1'))

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