aboutsummaryrefslogtreecommitdiffstats
path: root/test_archivemail
diff options
context:
space:
mode:
authorNikolaus Schulz <microschulz@web.de>2011-07-05 23:10:27 +0200
committerNikolaus Schulz <microschulz@web.de>2011-07-05 23:45:28 +0200
commit6b0fefc45f8d386324ed30324d073fc1e6cd4b87 (patch)
treeb643bac5aa5d49fbf51e30e07f3d05f1aa46b32f /test_archivemail
parentf6046b9d698af67b981055d68681392205f8573c (diff)
downloadarchivemail-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-xtest_archivemail21
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):