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

All Samples(18)  |  Call(12)  |  Derive(0)  |  Import(6)

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_utils.py   Products.Archetypes(Download)
from Products.Archetypes.utils import DisplayList
from Products.Archetypes.utils import IntDisplayList
from Products.Archetypes.utils import Vocabulary
from Products.Archetypes.utils import make_uuid
 
    def test_getValue(self):
        a = (('a', 'A',), ('b', '\xc3\xab'), ('c', u'xeb'), ('d', 42))
        dla = DisplayList(a)
        va = Vocabulary(dla, instance=None, i18n_domain=None)
        self.assertEqual(va.getValue('a'), 'A')
        b = (('A', 'a',), ('\xc3\xab', 'b'), (u'xeb', 'c'))
        dlb = DisplayList(b)
        vb = Vocabulary(dlb, instance=None, i18n_domain=None)
        self.assertEqual(vb.getValue('A'), 'a')
        self.assertEqual(vb.getValue('\xc3\xab'), 'b')
        c = ((1, 'A',), (2, '\xc3\xab'), (3, u'xeb'), (4, 42))
        dlc = IntDisplayList(c)
        vb = Vocabulary(dlc, instance=None, i18n_domain=None)
        self.assertEqual(dlc.getValue(1), 'A')
        self.assertEqual(dlc.getValue(2), '\xc3\xab')
        a = (('a', 'A',), ('b', '\xc3\xab'), ('c', u'xeb'), ('d', 42))
        dla = DisplayList(a)
        va = Vocabulary(dla, instance=object(), i18n_domain='plone')
        self.assertEqual(va.getValue('a'), 'A')
        self.assertEqual(va.getValue('b'), '\xc3\xab'.decode('utf-8'))

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_utils.py   Products.Archetypes(Download)
from Products.Archetypes.utils import DisplayList
from Products.Archetypes.utils import IntDisplayList
from Products.Archetypes.utils import Vocabulary
from Products.Archetypes.utils import make_uuid
 
    def test_getValue(self):
        a = (('a', 'A',), ('b', '\xc3\xab'), ('c', u'xeb'), ('d', 42))
        dla = DisplayList(a)
        va = Vocabulary(dla, instance=None, i18n_domain=None)
        self.assertEqual(va.getValue('a'), 'A')
        b = (('A', 'a',), ('\xc3\xab', 'b'), (u'xeb', 'c'))
        dlb = DisplayList(b)
        vb = Vocabulary(dlb, instance=None, i18n_domain=None)
        self.assertEqual(vb.getValue('A'), 'a')
        self.assertEqual(vb.getValue('\xc3\xab'), 'b')
        c = ((1, 'A',), (2, '\xc3\xab'), (3, u'xeb'), (4, 42))
        dlc = IntDisplayList(c)
        vb = Vocabulary(dlc, instance=None, i18n_domain=None)
        self.assertEqual(dlc.getValue(1), 'A')
        self.assertEqual(dlc.getValue(2), '\xc3\xab')
        a = (('a', 'A',), ('b', '\xc3\xab'), ('c', u'xeb'), ('d', 42))
        dla = DisplayList(a)
        va = Vocabulary(dla, instance=object(), i18n_domain='plone')
        self.assertEqual(va.getValue('a'), 'A')
        self.assertEqual(va.getValue('b'), '\xc3\xab'.decode('utf-8'))

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/Field.py   Products.Archetypes(Download)
from Products.Archetypes.utils import DisplayList
from Products.Archetypes.utils import IntDisplayList
from Products.Archetypes.utils import Vocabulary
from Products.Archetypes.utils import className
from Products.Archetypes.utils import mapply

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/Field.py   Products.Archetypes(Download)
from Products.Archetypes.utils import DisplayList
from Products.Archetypes.utils import IntDisplayList
from Products.Archetypes.utils import Vocabulary
from Products.Archetypes.utils import className
from Products.Archetypes.utils import mapply

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/atapi.py   Products.Archetypes(Download)
from Products.Archetypes.utils import DisplayList
from Products.Archetypes.utils import IntDisplayList
from Products.Archetypes.utils import Vocabulary
from Products.Archetypes.ClassGen import AT_GENERATE_METHOD
from Products.Archetypes.BaseUnit import BaseUnit

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/atapi.py   Products.Archetypes(Download)
from Products.Archetypes.utils import DisplayList
from Products.Archetypes.utils import IntDisplayList
from Products.Archetypes.utils import Vocabulary
from Products.Archetypes.ClassGen import AT_GENERATE_METHOD
from Products.Archetypes.BaseUnit import BaseUnit