]> granicus.if.org Git - python/commitdiff
Add a test for get_all() returning failobj. msg_20.txt is a sample
authorBarry Warsaw <barry@python.org>
Tue, 9 Oct 2001 15:49:35 +0000 (15:49 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 9 Oct 2001 15:49:35 +0000 (15:49 +0000)
message with multiple CC: fields, used in the get_all() test.

Lib/test/data/msg_20.txt [new file with mode: 0644]
Lib/test/test_email.py

diff --git a/Lib/test/data/msg_20.txt b/Lib/test/data/msg_20.txt
new file mode 100644 (file)
index 0000000..1a6a887
--- /dev/null
@@ -0,0 +1,22 @@
+Return-Path: <bbb@zzz.org>
+Delivered-To: bbb@zzz.org
+Received: by mail.zzz.org (Postfix, from userid 889)
+       id 27CEAD38CC; Fri,  4 May 2001 14:05:44 -0400 (EDT)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Transfer-Encoding: 7bit
+Message-ID: <15090.61304.110929.45684@aaa.zzz.org>
+From: bbb@ddd.com (John X. Doe)
+To: bbb@zzz.org
+Cc: ccc@zzz.org
+CC: ddd@zzz.org
+cc: eee@zzz.org
+Subject: This is a test message
+Date: Fri, 4 May 2001 14:05:44 -0400
+
+
+Hi,
+
+Do you like this message?
+
+-Me
index 0a6b8083a880ebbb90843d9509ed4718c454effe..06aae2b46777cd63550afc408e22158dd21993c3 100644 (file)
@@ -50,6 +50,12 @@ class TestEmailBase(unittest.TestCase):
 \f
 # Test various aspects of the Message class's API
 class TestMessageAPI(TestEmailBase):
+    def test_get_all(self):
+        eq = self.assertEqual
+        msg = self._msgobj('msg_20.txt')
+        eq(msg.get_all('cc'), ['ccc@zzz.org', 'ddd@zzz.org', 'eee@zzz.org'])
+        eq(msg.get_all('xx', 'n/a'), 'n/a')
+
     def test_get_charsets(self):
         eq = self.assertEqual