diff options
author | Nikolaus Schulz <microschulz@web.de> | 2011-07-05 23:10:27 +0200 |
---|---|---|
committer | Nikolaus Schulz <microschulz@web.de> | 2011-07-05 23:45:28 +0200 |
commit | 6b0fefc45f8d386324ed30324d073fc1e6cd4b87 (patch) | |
tree | b643bac5aa5d49fbf51e30e07f3d05f1aa46b32f /test_archivemail | |
parent | f6046b9d698af67b981055d68681392205f8573c (diff) | |
download | archivemail-6b0fefc45f8d386324ed30324d073fc1e6cd4b87.tar.gz archivemail-6b0fefc45f8d386324ed30324d073fc1e6cd4b87.tar.bz2 archivemail-6b0fefc45f8d386324ed30324d073fc1e6cd4b87.zip |
IMAP: add support for non-ascii mailbox names
Diffstat (limited to 'test_archivemail')
-rwxr-xr-x | test_archivemail | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test_archivemail b/test_archivemail index d3455b2..c9f217c 100755 --- a/test_archivemail +++ b/test_archivemail @@ -639,6 +639,27 @@ class TestIMAPQuoting(unittest.TestCase): self.assertEqual(unquoted, archivemail.imap_unquote(quoted)) +########## Modified UTF-7 support functions ########## + +class TestModUTF7(unittest.TestCase): + goodpairs = ( + (u"A\N{NOT IDENTICAL TO}A.", "A&ImI-A."), + (u"Hi Mom -\N{WHITE SMILING FACE}-!", "Hi Mom -&Jjo--!"), + (u"~peter/mail/\u53f0\u5317/\u65e5\u672c\u8a9e", + "~peter/mail/&U,BTFw-/&ZeVnLIqe-") + ) + + def testEncode(self): + """Ensure that encoding text in modified UTF-7 works properly.""" + for text, code in self.goodpairs: + self.assertEqual(archivemail.mod_utf7_encode(text), code) + + def testDecode(self): + """Ensure that decoding modified UTF-7 to text works properly.""" + for text, code in self.goodpairs: + self.assertEqual(archivemail.mod_utf7_decode(code), text) + + ########## acceptance testing ########### class TestArchive(TestCaseInTempdir): |