Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(22)  |  Call(22)  |  Derive(0)  |  Import(0)

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_validation.py   Products.Archetypes(Download)
    def test_inNumericRange(self):
        v = validationService.validatorFor('inNumericRange')
        self.assertEqual(v(10, 1, 20), 1)
        self.assertEqual(v('10', 1, 20), 1)
        self.assertNotEqual(v(0, 4, 5), 1)
 
    def test_isPrintable(self):
        v = validationService.validatorFor('isPrintable')
        self.assertEqual(v('text'), 1)
        self.assertNotEqual(v('\u203'), 1)
    def test_isPrintable(self):
        v = validationService.validatorFor('isPrintable')
        self.assertEqual(v('text'), 1)
        self.assertNotEqual(v('\u203'), 1)
        self.assertNotEqual(v(10), 1)
    def test_isURL(self):
        v = validationService.validatorFor('isURL')
        self.assertEqual(v('http://foo.bar:8080/manage'), 1)
        self.assertNotEqual(v('http://\n'), 1)
        self.assertNotEqual(v('../foo/bar'), 1)

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_validation.py   Products.Archetypes(Download)
    def test_inNumericRange(self):
        v = validationService.validatorFor('inNumericRange')
        self.assertEqual(v(10, 1, 20), 1)
        self.assertEqual(v('10', 1, 20), 1)
        self.assertNotEqual(v(0, 4, 5), 1)
 
    def test_isPrintable(self):
        v = validationService.validatorFor('isPrintable')
        self.assertEqual(v('text'), 1)
        self.assertNotEqual(v('\u203'), 1)
    def test_isPrintable(self):
        v = validationService.validatorFor('isPrintable')
        self.assertEqual(v('text'), 1)
        self.assertNotEqual(v('\u203'), 1)
        self.assertNotEqual(v(10), 1)
    def test_isURL(self):
        v = validationService.validatorFor('isURL')
        self.assertEqual(v('http://foo.bar:8080/manage'), 1)
        self.assertNotEqual(v('http://\n'), 1)
        self.assertNotEqual(v('../foo/bar'), 1)