예제 #1
0
 def test_tuplize(self):
     assert (tuplize('string', 'one two three') == ('one', 'two', 'three'))
     assert (tuplize('string', 'one,two,three',
                     comma_split) == ('one', 'two', 'three'))
     assert (tuplize('list', ['one', ' two', 'three ']) == ('one', ' two',
                                                            'three '))
     assert (tuplize('tuple',
                     ('one', 'two', 'three')) == ('one', 'two', 'three'))
예제 #2
0
    def test_tuplize(self):
        wanted = ('one', 'two', 'three')

        self.assertEqual(tuplize('string', 'one two three'), wanted)
        self.assertEqual(tuplize('unicode', u'one two three'), wanted)
        self.assertEqual(tuplize('string', 'one,two,three', comma_split),
                         wanted)
        self.assertEqual(tuplize('list', ['one', ' two', 'three ']), wanted)
        self.assertEqual(tuplize('tuple', ('one', 'two', 'three')), wanted)
예제 #3
0
파일: test_utils.py 프로젝트: goschtl/zope
    def test_tuplize(self):
        wanted = ('one','two','three')

        self.assertEqual( tuplize('string', 'one two three'), wanted )
        self.assertEqual( tuplize('unicode', u'one two three'), wanted )
        self.assertEqual( tuplize('string', 'one,two,three', comma_split),
                          wanted )
        self.assertEqual( tuplize('list', ['one',' two','three ']), wanted )
        self.assertEqual( tuplize('tuple', ('one','two','three')), wanted )
예제 #4
0
    def test_tuplize(self):
        from Products.CMFDefault.utils import comma_split
        from Products.CMFDefault.utils import tuplize
        wanted = ('one', 'two', 'three')

        self.assertEqual(tuplize('string', 'one two three'), wanted)
        self.assertEqual(tuplize('unicode', u'one two three'), wanted)
        self.assertEqual(tuplize('string', 'one,two,three', comma_split),
                         wanted)
        self.assertEqual(tuplize('list', ['one', ' two', 'three ']), wanted)
        self.assertEqual(tuplize('tuple', ('one', 'two', 'three')), wanted)
예제 #5
0
파일: test_utils.py 프로젝트: goschtl/zope
    def test_tuplize(self):
        from Products.CMFDefault.utils import comma_split
        from Products.CMFDefault.utils import tuplize
        wanted = ('one','two','three')

        self.assertEqual( tuplize('string', 'one two three'), wanted )
        self.assertEqual( tuplize('unicode', u'one two three'), wanted )
        self.assertEqual( tuplize('string', 'one,two,three', comma_split),
                          wanted )
        self.assertEqual( tuplize('list', ['one',' two','three ']), wanted )
        self.assertEqual( tuplize('tuple', ('one','two','three')), wanted )
예제 #6
0
 def setSubject(self, subject):
     subject = tuplize('subject', subject)
     s = []
     for part in subject:
         if isinstance(part, str):
             part = part.decode('utf-8')
         s.append(part)
     self.subject = tuple(s)
예제 #7
0
 def setCreators(self, creators):
     creators = tuplize('creators', creators)
     s = []
     for part in creators:
         if isinstance(part, str):
             part = part.decode('utf-8')
         s.append(part)
     self.creators = tuple(s)
예제 #8
0
 def setSubject(self, subject):
     subject = tuplize('subject', subject)
     s = []
     for part in subject:
         if isinstance(part, str):
             part = part.decode('utf-8')
         s.append(part)
     self.subject = tuple(s)
예제 #9
0
 def setSubject( self, subject ):
     """ Set Dublin Core Subject element - resource keywords.
     """
     self.subject = tuplize( 'subject', subject )
예제 #10
0
 def setCreators(self, creators):
     """ Set Dublin Core Creator elements - resource authors.
     """
     self.creators = tuplize('creators', creators)
예제 #11
0
파일: test_utils.py 프로젝트: goschtl/zope
 def test_tuplize( self ):
     assert( tuplize('string', 'one two three') == ('one','two','three'))
     assert( tuplize('string', 'one,two,three', comma_split) == ('one','two','three'))
     assert( tuplize('list', ['one',' two','three ']) == ('one',' two','three '))
     assert( tuplize('tuple', ('one','two','three')) == ('one','two','three'))
예제 #12
0
 def setVersions(self, versions):
     """OMF version elements."""
     self.versions = tuplize('versions', versions, semi_split)
예제 #13
0
 def setCoverages(self, coverages):
     """OMF coverage elements."""
     self.coverages = tuplize('coverages', coverages, semi_split)
예제 #14
0
 def setAuthors(self, authors):
     """OMF creator elements."""
     self.authors = tuplize('authors', authors, semi_split)
예제 #15
0
 def setSources(self, sources):
     """OMF source elements."""
     self.sources = tuplize('sources', sources, semi_split)
예제 #16
0
 def setIdentifiers(self, identifiers):
     """OMF identifier elements."""
     self.identifiers = tuplize('identifiers', identifiers, semi_split)
예제 #17
0
 def setFormats(self, formats):
     """OMF format elements."""
     self.formats = tuplize('formats', formats, semi_split)
예제 #18
0
 def setTypes(self, types):
     """OMF type elements."""
     self.types = tuplize('types', types, semi_split)
예제 #19
0
 def setContributors( self, contributors ):
     """ Set Dublin Core Contributor elements - resource collaborators.
     """
     # XXX: fixme
     self.contributors = tuplize('contributors', contributors, semi_split)
예제 #20
0
 def setRelations(self, relations):
     """OMF relation elements."""
     self.relations = tuplize('relations', relations, semi_split)
예제 #21
0
 def setMaintainers(self, maintainers):
     """OMF maintainer elements."""
     self.maintainers = tuplize('maintainers', maintainers, semi_split)