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

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

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_utils.py   Products.Archetypes(Download)
            uid = make_uuid()
            uids[uid] = 1
        self.assertEqual(len(uids), loop_length)
 
 
    def test_getValue(self):
        a = (('a', 'A',), ('b', '\xc3\xab'), ('c', u'xeb'), ('d', 42))
        dla = DisplayList(a)
        self.assertEqual(dla.getValue('a'), 'A')
        self.assertEqual(dla.getValue('b'), '\xc3\xab')
        self.assertEqual(dla.getValue('c'), u'xeb')
        self.assertEqual(dla.getValue('d'), 42)

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_utils.py   Products.Archetypes(Download)
            uid = make_uuid()
            uids[uid] = 1
        self.assertEqual(len(uids), loop_length)
 
 
    def test_getValue(self):
        a = (('a', 'A',), ('b', '\xc3\xab'), ('c', u'xeb'), ('d', 42))
        dla = DisplayList(a)
        self.assertEqual(dla.getValue('a'), 'A')
        self.assertEqual(dla.getValue('b'), '\xc3\xab')
        self.assertEqual(dla.getValue('c'), u'xeb')
        self.assertEqual(dla.getValue('d'), 42)

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)
    def test_isSSN(self):
        v = validationService.validatorFor('isSSN')
        self.assertEqual(v('111223333'), 1)
        self.assertEqual(v('111-22-3333', ignore=r'-'), 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)
    def test_isSSN(self):
        v = validationService.validatorFor('isSSN')
        self.assertEqual(v('111223333'), 1)
        self.assertEqual(v('111-22-3333', ignore=r'-'), 1)
 

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_schemata_manipulation.py   Products.Archetypes(Download)
    def testBasic(self):
        self.assertEqual(self.fields2names(self.schema.fields()),
                        ['a', 'd', 'x', 'b', 'e', 'y', 'c', 'f', 'z'])
        self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'nasbaer', 'edgar'])
        self.schema.addField(StringField('p', schemata='waldi'))
        self.schema.addField(StringField('hello_world', schemata='helloworld'))
        self.schema.addField(StringField('hello_world1', schemata='helloworld1'))
        self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'nasbaer', 'edgar', 'helloworld', 'helloworld1'])
    def testSchemataFields(self):
        self.assertEqual(self.fields2names(self.schema.getSchemataFields('waldi')),
                        ['a', 'b', 'c'])
        self.assertEqual(self.fields2names(self.schema.getSchemataFields('nasbaer')),
                        ['d', 'e', 'f'])

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_schemata_manipulation.py   Products.Archetypes(Download)
    def testBasic(self):
        self.assertEqual(self.fields2names(self.schema.fields()),
                        ['a', 'd', 'x', 'b', 'e', 'y', 'c', 'f', 'z'])
        self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'nasbaer', 'edgar'])
        self.schema.addField(StringField('p', schemata='waldi'))
        self.schema.addField(StringField('hello_world', schemata='helloworld'))
        self.schema.addField(StringField('hello_world1', schemata='helloworld1'))
        self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'nasbaer', 'edgar', 'helloworld', 'helloworld1'])
    def testSchemataFields(self):
        self.assertEqual(self.fields2names(self.schema.getSchemataFields('waldi')),
                        ['a', 'b', 'c'])
        self.assertEqual(self.fields2names(self.schema.getSchemataFields('nasbaer')),
                        ['d', 'e', 'f'])

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_varschema.py   Products.Archetypes(Download)
    def test_variableschema(self):
        self.folder.dummy = Dummy(oid='dummy')
        dummy = self.folder.dummy
        dummy.setTitle('dummy1')
        self.assertEqual(dummy.Title(), 'dummy1')
 
        #change the schema
        dummy.schema = schema1
        #try to read an old value using the new schema
        self.assertEqual(dummy.Title(), 'dummy1')
        dummy.setAdditionalField('flurb')
        #check if we can read the new field using the new schema
        self.assertEqual(dummy.getAdditionalField(), 'flurb')
 
 

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_varschema.py   Products.Archetypes(Download)
    def test_variableschema(self):
        self.folder.dummy = Dummy(oid='dummy')
        dummy = self.folder.dummy
        dummy.setTitle('dummy1')
        self.assertEqual(dummy.Title(), 'dummy1')
 
        #change the schema
        dummy.schema = schema1
        #try to read an old value using the new schema
        self.assertEqual(dummy.Title(), 'dummy1')
        dummy.setAdditionalField('flurb')
        #check if we can read the new field using the new schema
        self.assertEqual(dummy.getAdditionalField(), 'flurb')