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

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

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_utils.py   Products.Archetypes(Download)
    def test_cmp(self):
        ta = ('a', 'b', 'c')
        tb = ('a', 'c', 'b')
        td = ('c', 'b', 'a')
        self.assertTrue(DisplayList(zip(ta, ta)) == DisplayList(zip(ta, ta)))
        self.assertFalse(DisplayList(zip(ta, ta)) == DisplayList(zip(ta, tb)))
        self.assertTrue(DisplayList(zip(ta, ta)) == DisplayList(zip(td, td)))
        self.assertTrue(DisplayList(zip(tb, ta)) == DisplayList(zip(tb, ta)))
    def test_slice(self):
        ta = ('a', 'b', 'c')
        l = zip(ta, ta)
        sub = l[1:]
        self.assertTrue(DisplayList(l)[1:] == sub)
        for i in range(0, 2):
            item = ta[i]
            self.assertTrue(DisplayList(l)[i] == item)
 
    def test_add(self):

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_utils.py   Products.Archetypes(Download)
    def test_cmp(self):
        ta = ('a', 'b', 'c')
        tb = ('a', 'c', 'b')
        td = ('c', 'b', 'a')
        self.assertTrue(DisplayList(zip(ta, ta)) == DisplayList(zip(ta, ta)))
        self.assertFalse(DisplayList(zip(ta, ta)) == DisplayList(zip(ta, tb)))
        self.assertTrue(DisplayList(zip(ta, ta)) == DisplayList(zip(td, td)))
        self.assertTrue(DisplayList(zip(tb, ta)) == DisplayList(zip(tb, ta)))
    def test_slice(self):
        ta = ('a', 'b', 'c')
        l = zip(ta, ta)
        sub = l[1:]
        self.assertTrue(DisplayList(l)[1:] == sub)
        for i in range(0, 2):
            item = ta[i]
            self.assertTrue(DisplayList(l)[i] == item)
 
    def test_add(self):

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_utils2.py   Products.Archetypes(Download)
    def test_order(self):
        self.assertTrue(self.d.keys() == ['a', 'b', 'c'])
        self.assertTrue(self.d.values() == ['1', '2', '3'])
        self.assertTrue(self.d.items() == [('a', '1'), ('b', '2'), ('c', '3')])
        self.assertTrue(self.d.reverse() == [('c', '3'), ('b', '2'), ('a', '1')])
 
    def test_setitem(self):
        self.d['d'] = '4'
        self.assertTrue(self.d.keys() == ['a', 'b', 'c', 'd'])

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_utils2.py   Products.Archetypes(Download)
    def test_order(self):
        self.assertTrue(self.d.keys() == ['a', 'b', 'c'])
        self.assertTrue(self.d.values() == ['1', '2', '3'])
        self.assertTrue(self.d.items() == [('a', '1'), ('b', '2'), ('c', '3')])
        self.assertTrue(self.d.reverse() == [('c', '3'), ('b', '2'), ('a', '1')])
 
    def test_setitem(self):
        self.d['d'] = '4'
        self.assertTrue(self.d.keys() == ['a', 'b', 'c', 'd'])

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_fieldvalidation.py   Products.Archetypes(Download)
                  (setting, result)
 
            self.assertTrue(setting['assertion'](result),
                         setting.get('failmsg', msg))
 
    def testIntegerZeroInvalid(self):
        # attach a validator that never validates, so any value must fail
        field = IntegerField('integer', validators=('v3',))
 
        self.assertTrue(field.validate(1, self.instance, errors={}) is not None)
        self.assertTrue(field.validate(0, self.instance, errors={}) is not None)

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_fieldvalidation.py   Products.Archetypes(Download)
                  (setting, result)
 
            self.assertTrue(setting['assertion'](result),
                         setting.get('failmsg', msg))
 
    def testIntegerZeroInvalid(self):
        # attach a validator that never validates, so any value must fail
        field = IntegerField('integer', validators=('v3',))
 
        self.assertTrue(field.validate(1, self.instance, errors={}) is not None)
        self.assertTrue(field.validate(0, self.instance, errors={}) is not None)