# Released subject to the New BSD License
# Please see http://en.wikipedia.org/wiki/BSD_licenses
+from imapclient.six import u
from imapclient.imap_utf7 import decode, encode, FolderNameError
from imapclient.test.util import unittest
['Foo', 'Foo'],
['Foo Bar', 'Foo Bar'],
['Stuff & Things', 'Stuff &- Things'],
- [u'Hello world', 'Hello world'],
- [u'Hello & world', 'Hello &- world'],
- [u'Hello\xffworld', 'Hello&AP8-world'],
- [u'\xff\xfe\xfd\xfc', '&AP8A,gD9APw-'],
- [u'~peter/mail/\u65e5\u672c\u8a9e/\u53f0\u5317',
+ [u('Hello world'), 'Hello world'],
+ [u('Hello & world'), 'Hello &- world'],
+ [u('Hello\xffworld'), 'Hello&AP8-world'],
+ [u('\xff\xfe\xfd\xfc'), '&AP8A,gD9APw-'],
+ [u('~peter/mail/\u65e5\u672c\u8a9e/\u53f0\u5317'),
'~peter/mail/&ZeVnLIqe-/&U,BTFw-'], # example from RFC 2060
['\x00foo', '&AAA-foo'],
]
from datetime import datetime
from StringIO import StringIO
-from imapclient.six import advance_iterator
+from imapclient.six import advance_iterator, u
from imapclient.fixed_offset import FixedOffset
from imapclient.imapclient import datetime_to_imap
from imapclient.test.mock import patch, sentinel, Mock
folders = self.client._proc_folder_list([('(\\NoInferiors \\UnMarked) "/" {5}', 'bang\xff'),
'',
'(\\HasNoChildren \\UnMarked) "/" "INBOX"'])
- self.assertEqual(folders, [(['\\NoInferiors', '\\UnMarked'], "/", u'bang\xff'),
- (['\\HasNoChildren', '\\UnMarked'], "/", u'INBOX')])
+ self.assertEqual(folders, [(['\\NoInferiors', '\\UnMarked'], "/", u('bang\xff')),
+ (['\\HasNoChildren', '\\UnMarked'], "/", u('INBOX'))])
def test_quoted_specials(self):
def test_setacl(self):
self.client._imap.setacl.return_value = ('OK', ["SETACL done"])
- response = self.client.setacl(u'folder', sentinel.who, sentinel.what)
+ response = self.client.setacl(u('folder'), sentinel.who, sentinel.what)
self.client._imap.setacl.assert_called_with('"folder"', sentinel.who, sentinel.what)
self.assertEqual(response, "SETACL done")