test_quote_unquote(): Added a test for the rfc822.unquote() patch
authorBarry Warsaw <barry@python.org>
Wed, 11 Sep 2002 02:32:57 +0000 (02:32 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 11 Sep 2002 02:32:57 +0000 (02:32 +0000)
(adapted from Quinn Dunkan's mimelib SF patch #573204).

Lib/test/test_rfc822.py

index 0bdd99afb37c0b8e210e926473ef7def9f76e14d..c450bf97ce09e4a37747a8920cafee5bd59d14bb 100644 (file)
@@ -222,6 +222,12 @@ A test message.
         eq(rfc822.parseaddr('Cynthia Person <cperson@dom.ain>'),
            ('Cynthia Person', 'cperson@dom.ain'))
 
+    def test_quote_unquote(self):
+        eq = self.assertEqual
+        eq(rfc822.quote('foo\\wacky"name'), 'foo\\\\wacky\\"name')
+        eq(rfc822.unquote('"foo\\\\wacky\\"name"'), 'foo\\wacky"name')
+
+
 def test_main():
     test_support.run_unittest(MessageTestCase)