| OLD | NEW |
| 1 # Copyright (C) 2001-2007 Python Software Foundation | 1 # Copyright (C) 2001-2007 Python Software Foundation |
| 2 # Contact: email-sig@python.org | 2 # Contact: email-sig@python.org |
| 3 # email package unit tests | 3 # email package unit tests |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 import sys | 6 import sys |
| 7 import time | 7 import time |
| 8 import base64 | 8 import base64 |
| 9 import difflib | 9 import difflib |
| 10 import unittest | 10 import unittest |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 eq(msg['content-transfer-encoding'], 'quoted-printable') | 537 eq(msg['content-transfer-encoding'], 'quoted-printable') |
| 538 | 538 |
| 539 | 539 |
| 540 | 540 |
| 541 # Test long header wrapping | 541 # Test long header wrapping |
| 542 class TestLongHeaders(TestEmailBase): | 542 class TestLongHeaders(TestEmailBase): |
| 543 def test_split_long_continuation(self): | 543 def test_split_long_continuation(self): |
| 544 eq = self.ndiffAssertEqual | 544 eq = self.ndiffAssertEqual |
| 545 msg = email.message_from_string("""\ | 545 msg = email.message_from_string("""\ |
| 546 Subject: bug demonstration | 546 Subject: bug demonstration |
| 547 \t123456789112345678921234567893123456789412345678951234567896123456789712345678
98112345678911234567892123456789112345678911234567892123456789 | 547 1234567891123456789212345678931234567894123456789512345678961234567897123456789
8112345678911234567892123456789112345678911234567892123456789 |
| 548 \tmore text | 548 more text |
| 549 | 549 |
| 550 test | 550 test |
| 551 """) | 551 """) |
| 552 sfp = StringIO() | 552 sfp = StringIO() |
| 553 g = Generator(sfp) | 553 g = Generator(sfp) |
| 554 g.flatten(msg) | 554 g.flatten(msg) |
| 555 eq(sfp.getvalue(), """\ | 555 eq(sfp.getvalue(), """\ |
| 556 Subject: bug demonstration | 556 Subject: bug demonstration |
| 557 \t123456789112345678921234567893123456789412345678951234567896123456789712345678
98112345678911234567892123456789112345678911234567892123456789 | 557 1234567891123456789212345678931234567894123456789512345678961234567897123456789
8112345678911234567892123456789112345678911234567892123456789 |
| 558 \tmore text | 558 more text |
| 559 | 559 |
| 560 test | 560 test |
| 561 """) | 561 """) |
| 562 | 562 |
| 563 def test_another_long_almost_unsplittable_header(self): | 563 def test_another_long_almost_unsplittable_header(self): |
| 564 eq = self.ndiffAssertEqual | 564 eq = self.ndiffAssertEqual |
| 565 hstr = """\ | 565 hstr = """\ |
| 566 bug demonstration | 566 bug demonstration |
| 567 \t123456789112345678921234567893123456789412345678951234567896123456789712345678
98112345678911234567892123456789112345678911234567892123456789 | 567 1234567891123456789212345678931234567894123456789512345678961234567897123456789
8112345678911234567892123456789112345678911234567892123456789 |
| 568 \tmore text""" | 568 more text""" |
| 569 h = Header(hstr, continuation_ws='\t') | 569 h = Header(hstr, continuation_ws='\t') |
| 570 eq(h.encode(), """\ | 570 eq(h.encode(), """\ |
| 571 bug demonstration | 571 bug demonstration |
| 572 \t123456789112345678921234567893123456789412345678951234567896123456789712345678
98112345678911234567892123456789112345678911234567892123456789 | 572 \t123456789112345678921234567893123456789412345678951234567896123456789712345678
98112345678911234567892123456789112345678911234567892123456789 |
| 573 \tmore text""") | 573 \tmore text""") |
| 574 h = Header(hstr) | 574 h = Header(hstr) |
| 575 eq(h.encode(), """\ | 575 eq(h.encode(), """\ |
| 576 bug demonstration | 576 bug demonstration |
| 577 1234567891123456789212345678931234567894123456789512345678961234567897123456789
8112345678911234567892123456789112345678911234567892123456789 | 577 1234567891123456789212345678931234567894123456789512345678961234567897123456789
8112345678911234567892123456789112345678911234567892123456789 |
| 578 more text""") | 578 more text""") |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 'wasnipoop; giraffes="very-long-necked-animals"; ' | 648 'wasnipoop; giraffes="very-long-necked-animals"; ' |
| 649 'spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"') | 649 'spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"') |
| 650 sfp = StringIO() | 650 sfp = StringIO() |
| 651 g = Generator(sfp) | 651 g = Generator(sfp) |
| 652 g.flatten(msg) | 652 g.flatten(msg) |
| 653 eq(sfp.getvalue(), '''\ | 653 eq(sfp.getvalue(), '''\ |
| 654 Content-Type: text/plain; charset="us-ascii" | 654 Content-Type: text/plain; charset="us-ascii" |
| 655 MIME-Version: 1.0 | 655 MIME-Version: 1.0 |
| 656 Content-Transfer-Encoding: 7bit | 656 Content-Transfer-Encoding: 7bit |
| 657 X-Foobar-Spoink-Defrobnit: wasnipoop; giraffes="very-long-necked-animals"; | 657 X-Foobar-Spoink-Defrobnit: wasnipoop; giraffes="very-long-necked-animals"; |
| 658 \tspooge="yummy"; hippos="gargantuan"; marshmallows="gooey" | 658 spooge="yummy"; hippos="gargantuan"; marshmallows="gooey" |
| 659 | 659 |
| 660 ''') | 660 ''') |
| 661 | 661 |
| 662 def test_no_semis_header_splitter(self): | 662 def test_no_semis_header_splitter(self): |
| 663 eq = self.ndiffAssertEqual | 663 eq = self.ndiffAssertEqual |
| 664 msg = Message() | 664 msg = Message() |
| 665 msg['From'] = 'test@dom.ain' | 665 msg['From'] = 'test@dom.ain' |
| 666 msg['References'] = SPACE.join(['<%d@dom.ain>' % i for i in range(10)]) | 666 msg['References'] = SPACE.join(['<%d@dom.ain>' % i for i in range(10)]) |
| 667 msg.set_payload('Test') | 667 msg.set_payload('Test') |
| 668 sfp = StringIO() | 668 sfp = StringIO() |
| 669 g = Generator(sfp) | 669 g = Generator(sfp) |
| 670 g.flatten(msg) | 670 g.flatten(msg) |
| 671 eq(sfp.getvalue(), """\ | 671 eq(sfp.getvalue(), """\ |
| 672 From: test@dom.ain | 672 From: test@dom.ain |
| 673 References: <0@dom.ain> <1@dom.ain> <2@dom.ain> <3@dom.ain> <4@dom.ain> | 673 References: <0@dom.ain> <1@dom.ain> <2@dom.ain> <3@dom.ain> <4@dom.ain> |
| 674 \t<5@dom.ain> <6@dom.ain> <7@dom.ain> <8@dom.ain> <9@dom.ain> | 674 <5@dom.ain> <6@dom.ain> <7@dom.ain> <8@dom.ain> <9@dom.ain> |
| 675 | 675 |
| 676 Test""") | 676 Test""") |
| 677 | 677 |
| 678 def test_no_split_long_header(self): | 678 def test_no_split_long_header(self): |
| 679 eq = self.ndiffAssertEqual | 679 eq = self.ndiffAssertEqual |
| 680 hstr = 'References: ' + 'x' * 80 | 680 hstr = 'References: ' + 'x' * 80 |
| 681 h = Header(hstr, continuation_ws='\t') | 681 h = Header(hstr) |
| 682 eq(h.encode(), """\ | 682 eq(h.encode(), """\ |
| 683 References: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxx""") | 683 References: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxx""") |
| 684 | 684 |
| 685 def test_splitting_multiple_long_lines(self): | 685 def test_splitting_multiple_long_lines(self): |
| 686 eq = self.ndiffAssertEqual | 686 eq = self.ndiffAssertEqual |
| 687 hstr = """\ | 687 hstr = """\ |
| 688 from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org
(Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>
; Sat, 2 Feb 2002 17:00:06 -0800 (PST) | 688 from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org
(Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>
; Sat, 2 Feb 2002 17:00:06 -0800 (PST) |
| 689 \tfrom babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.o
rg (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.or
g>; Sat, 2 Feb 2002 17:00:06 -0800 (PST) | 689 \tfrom babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.o
rg (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.or
g>; Sat, 2 Feb 2002 17:00:06 -0800 (PST) |
| 690 \tfrom babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.o
rg (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.or
g>; Sat, 2 Feb 2002 17:00:06 -0800 (PST) | 690 \tfrom babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.o
rg (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.or
g>; Sat, 2 Feb 2002 17:00:06 -0800 (PST) |
| 691 """ | 691 """ |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 | 742 |
| 743 """) | 743 """) |
| 744 | 744 |
| 745 def test_long_to_header(self): | 745 def test_long_to_header(self): |
| 746 eq = self.ndiffAssertEqual | 746 eq = self.ndiffAssertEqual |
| 747 to = '"Someone Test #A" <someone@eecs.umich.edu>,<someone@eecs.umich.edu
>,"Someone Test #B" <someone@umich.edu>, "Someone Test #C" <someone@eecs.umich.e
du>, "Someone Test #D" <someone@eecs.umich.edu>' | 747 to = '"Someone Test #A" <someone@eecs.umich.edu>,<someone@eecs.umich.edu
>,"Someone Test #B" <someone@umich.edu>, "Someone Test #C" <someone@eecs.umich.e
du>, "Someone Test #D" <someone@eecs.umich.edu>' |
| 748 msg = Message() | 748 msg = Message() |
| 749 msg['To'] = to | 749 msg['To'] = to |
| 750 eq(msg.as_string(0), '''\ | 750 eq(msg.as_string(0), '''\ |
| 751 To: "Someone Test #A" <someone@eecs.umich.edu>, <someone@eecs.umich.edu>, | 751 To: "Someone Test #A" <someone@eecs.umich.edu>, <someone@eecs.umich.edu>, |
| 752 \t"Someone Test #B" <someone@umich.edu>, | 752 "Someone Test #B" <someone@umich.edu>, |
| 753 \t"Someone Test #C" <someone@eecs.umich.edu>, | 753 "Someone Test #C" <someone@eecs.umich.edu>, |
| 754 \t"Someone Test #D" <someone@eecs.umich.edu> | 754 "Someone Test #D" <someone@eecs.umich.edu> |
| 755 | 755 |
| 756 ''') | 756 ''') |
| 757 | 757 |
| 758 def test_long_line_after_append(self): | 758 def test_long_line_after_append(self): |
| 759 eq = self.ndiffAssertEqual | 759 eq = self.ndiffAssertEqual |
| 760 s = 'This is an example of string which has almost the limit of header l
ength.' | 760 s = 'This is an example of string which has almost the limit of header l
ength.' |
| 761 h = Header(s) | 761 h = Header(s) |
| 762 h.append('Add another line.') | 762 h.append('Add another line.') |
| 763 eq(h.encode(), """\ | 763 eq(h.encode(), """\ |
| 764 This is an example of string which has almost the limit of header length. | 764 This is an example of string which has almost the limit of header length. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 787 def test_long_received_header(self): | 787 def test_long_received_header(self): |
| 788 h = 'from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by hrothgar.la.
mastaler.com (tmda-ofmipd) with ESMTP; Wed, 05 Mar 2003 18:10:18 -0700' | 788 h = 'from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by hrothgar.la.
mastaler.com (tmda-ofmipd) with ESMTP; Wed, 05 Mar 2003 18:10:18 -0700' |
| 789 msg = Message() | 789 msg = Message() |
| 790 msg['Received-1'] = Header(h, continuation_ws='\t') | 790 msg['Received-1'] = Header(h, continuation_ws='\t') |
| 791 msg['Received-2'] = h | 791 msg['Received-2'] = h |
| 792 self.assertEqual(msg.as_string(), """\ | 792 self.assertEqual(msg.as_string(), """\ |
| 793 Received-1: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by | 793 Received-1: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by |
| 794 \throthgar.la.mastaler.com (tmda-ofmipd) with ESMTP; | 794 \throthgar.la.mastaler.com (tmda-ofmipd) with ESMTP; |
| 795 \tWed, 05 Mar 2003 18:10:18 -0700 | 795 \tWed, 05 Mar 2003 18:10:18 -0700 |
| 796 Received-2: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by | 796 Received-2: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by |
| 797 \throthgar.la.mastaler.com (tmda-ofmipd) with ESMTP; | 797 hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP; |
| 798 \tWed, 05 Mar 2003 18:10:18 -0700 | 798 Wed, 05 Mar 2003 18:10:18 -0700 |
| 799 | 799 |
| 800 """) | 800 """) |
| 801 | 801 |
| 802 def test_string_headerinst_eq(self): | 802 def test_string_headerinst_eq(self): |
| 803 h = '<15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de>
(David Bremner\'s message of "Thu, 6 Mar 2003 13:58:21 +0100")' | 803 h = '<15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de>
(David Bremner\'s message of "Thu, 6 Mar 2003 13:58:21 +0100")' |
| 804 msg = Message() | 804 msg = Message() |
| 805 msg['Received-1'] = Header(h, header_name='Received-1', | 805 msg['Received-1'] = Header(h, header_name='Received-1') |
| 806 continuation_ws='\t') | |
| 807 msg['Received-2'] = h | 806 msg['Received-2'] = h |
| 808 self.assertEqual(msg.as_string(), """\ | 807 self.assertEqual(msg.as_string(), """\ |
| 809 Received-1: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> | 808 Received-1: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de>
(David |
| 810 \t(David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100") | 809 Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100") |
| 811 Received-2: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> | 810 Received-2: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de>
(David |
| 812 \t(David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100") | 811 Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100") |
| 813 | 812 |
| 814 """) | 813 """) |
| 815 | 814 |
| 816 def test_long_unbreakable_lines_with_continuation(self): | 815 def test_long_unbreakable_lines_with_continuation(self): |
| 817 eq = self.ndiffAssertEqual | 816 eq = self.ndiffAssertEqual |
| 818 msg = Message() | 817 msg = Message() |
| 819 t = """\ | 818 t = """\ |
| 820 iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9 | 819 iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9 |
| 821 locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp""" | 820 locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp""" |
| 822 msg['Face-1'] = t | 821 msg['Face-1'] = t |
| 823 msg['Face-2'] = Header(t, header_name='Face-2') | 822 msg['Face-2'] = Header(t, header_name='Face-2') |
| 824 eq(msg.as_string(), """\ | 823 eq(msg.as_string(), """\ |
| 825 Face-1: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9 | 824 Face-1: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9 |
| 826 \tlocQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp | 825 locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp |
| 827 Face-2: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9 | 826 Face-2: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9 |
| 828 locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp | 827 locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp |
| 829 | 828 |
| 830 """) | 829 """) |
| 831 | 830 |
| 832 def test_another_long_multiline_header(self): | 831 def test_another_long_multiline_header(self): |
| 833 eq = self.ndiffAssertEqual | 832 eq = self.ndiffAssertEqual |
| 834 m = '''\ | 833 m = '''\ |
| 835 Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with Microsof
t SMTPSVC(5.0.2195.4905); | 834 Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with Microsof
t SMTPSVC(5.0.2195.4905); |
| 836 \tWed, 16 Oct 2002 07:41:11 -0700''' | 835 \tWed, 16 Oct 2002 07:41:11 -0700''' |
| 837 msg = email.message_from_string(m) | 836 msg = email.message_from_string(m) |
| 838 eq(msg.as_string(), '''\ | 837 eq(msg.as_string(), '''\ |
| 839 Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with | 838 Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with |
| 840 \tMicrosoft SMTPSVC(5.0.2195.4905); Wed, 16 Oct 2002 07:41:11 -0700 | 839 Microsoft SMTPSVC(5.0.2195.4905); Wed, 16 Oct 2002 07:41:11 -0700 |
| 841 | 840 |
| 842 ''') | 841 ''') |
| 843 | 842 |
| 844 def test_long_lines_with_different_header(self): | 843 def test_long_lines_with_different_header(self): |
| 845 eq = self.ndiffAssertEqual | 844 eq = self.ndiffAssertEqual |
| 846 h = """\ | 845 h = """\ |
| 847 List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/spamassassin-tal
k>, | 846 List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/spamassassin-tal
k>, |
| 848 <mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscr
ibe>""" | 847 <mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscr
ibe>""" |
| 849 msg = Message() | 848 msg = Message() |
| 850 msg['List'] = h | 849 msg['List'] = h |
| 851 msg['List'] = Header(h, header_name='List') | 850 msg['List'] = Header(h, header_name='List') |
| 852 eq(msg.as_string(), """\ | 851 eq(msg.as_string(), """\ |
| 853 List: List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/spamassass
in-talk>, | 852 List: List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/spamassass
in-talk>, |
| 854 \t<mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscribe> | 853 <mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscribe> |
| 855 List: List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/spamassass
in-talk>, | 854 List: List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/spamassass
in-talk>, |
| 856 <mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscribe> | 855 <mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscribe> |
| 857 | 856 |
| 858 """) | 857 """) |
| 859 | 858 |
| 860 | 859 |
| 861 | 860 |
| 862 # Test mangling of "From " lines in the body of a message | 861 # Test mangling of "From " lines in the body of a message |
| 863 class TestFromMangling(unittest.TestCase): | 862 class TestFromMangling(unittest.TestCase): |
| 864 def setUp(self): | 863 def setUp(self): |
| (...skipping 2111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2976 charset='us-ascii', language='en') | 2975 charset='us-ascii', language='en') |
| 2977 eq(msg.get_param('title'), | 2976 eq(msg.get_param('title'), |
| 2978 ('us-ascii', 'en', 'This is even more ***fun*** isn\'t it!')) | 2977 ('us-ascii', 'en', 'This is even more ***fun*** isn\'t it!')) |
| 2979 msg = self._msgobj('msg_01.txt') | 2978 msg = self._msgobj('msg_01.txt') |
| 2980 msg.set_param('title', 'This is even more ***fun*** isn\'t it!', | 2979 msg.set_param('title', 'This is even more ***fun*** isn\'t it!', |
| 2981 charset='us-ascii', language='en') | 2980 charset='us-ascii', language='en') |
| 2982 eq(msg.as_string(), """\ | 2981 eq(msg.as_string(), """\ |
| 2983 Return-Path: <bbb@zzz.org> | 2982 Return-Path: <bbb@zzz.org> |
| 2984 Delivered-To: bbb@zzz.org | 2983 Delivered-To: bbb@zzz.org |
| 2985 Received: by mail.zzz.org (Postfix, from userid 889) | 2984 Received: by mail.zzz.org (Postfix, from userid 889) |
| 2986 \tid 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) | 2985 id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) |
| 2987 MIME-Version: 1.0 | 2986 MIME-Version: 1.0 |
| 2988 Content-Transfer-Encoding: 7bit | 2987 Content-Transfer-Encoding: 7bit |
| 2989 Message-ID: <15090.61304.110929.45684@aaa.zzz.org> | 2988 Message-ID: <15090.61304.110929.45684@aaa.zzz.org> |
| 2990 From: bbb@ddd.com (John X. Doe) | 2989 From: bbb@ddd.com (John X. Doe) |
| 2991 To: bbb@zzz.org | 2990 To: bbb@zzz.org |
| 2992 Subject: This is a test message | 2991 Subject: This is a test message |
| 2993 Date: Fri, 4 May 2001 14:05:44 -0400 | 2992 Date: Fri, 4 May 2001 14:05:44 -0400 |
| 2994 Content-Type: text/plain; charset=us-ascii; | 2993 Content-Type: text/plain; charset=us-ascii; |
| 2995 \ttitle*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%
20it%21" | 2994 title*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%2
0it%21" |
| 2996 | 2995 |
| 2997 | 2996 |
| 2998 Hi, | 2997 Hi, |
| 2999 | 2998 |
| 3000 Do you like this message? | 2999 Do you like this message? |
| 3001 | 3000 |
| 3002 -Me | 3001 -Me |
| 3003 """) | 3002 """) |
| 3004 | 3003 |
| 3005 def test_del_param(self): | 3004 def test_del_param(self): |
| 3006 eq = self.ndiffAssertEqual | 3005 eq = self.ndiffAssertEqual |
| 3007 msg = self._msgobj('msg_01.txt') | 3006 msg = self._msgobj('msg_01.txt') |
| 3008 msg.set_param('foo', 'bar', charset='us-ascii', language='en') | 3007 msg.set_param('foo', 'bar', charset='us-ascii', language='en') |
| 3009 msg.set_param('title', 'This is even more ***fun*** isn\'t it!', | 3008 msg.set_param('title', 'This is even more ***fun*** isn\'t it!', |
| 3010 charset='us-ascii', language='en') | 3009 charset='us-ascii', language='en') |
| 3011 msg.del_param('foo', header='Content-Type') | 3010 msg.del_param('foo', header='Content-Type') |
| 3012 eq(msg.as_string(), """\ | 3011 eq(msg.as_string(), """\ |
| 3013 Return-Path: <bbb@zzz.org> | 3012 Return-Path: <bbb@zzz.org> |
| 3014 Delivered-To: bbb@zzz.org | 3013 Delivered-To: bbb@zzz.org |
| 3015 Received: by mail.zzz.org (Postfix, from userid 889) | 3014 Received: by mail.zzz.org (Postfix, from userid 889) |
| 3016 \tid 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) | 3015 id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT) |
| 3017 MIME-Version: 1.0 | 3016 MIME-Version: 1.0 |
| 3018 Content-Transfer-Encoding: 7bit | 3017 Content-Transfer-Encoding: 7bit |
| 3019 Message-ID: <15090.61304.110929.45684@aaa.zzz.org> | 3018 Message-ID: <15090.61304.110929.45684@aaa.zzz.org> |
| 3020 From: bbb@ddd.com (John X. Doe) | 3019 From: bbb@ddd.com (John X. Doe) |
| 3021 To: bbb@zzz.org | 3020 To: bbb@zzz.org |
| 3022 Subject: This is a test message | 3021 Subject: This is a test message |
| 3023 Date: Fri, 4 May 2001 14:05:44 -0400 | 3022 Date: Fri, 4 May 2001 14:05:44 -0400 |
| 3024 Content-Type: text/plain; charset="us-ascii"; | 3023 Content-Type: text/plain; charset="us-ascii"; |
| 3025 \ttitle*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%
20it%21" | 3024 title*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%2
0it%21" |
| 3026 | 3025 |
| 3027 | 3026 |
| 3028 Hi, | 3027 Hi, |
| 3029 | 3028 |
| 3030 Do you like this message? | 3029 Do you like this message? |
| 3031 | 3030 |
| 3032 -Me | 3031 -Me |
| 3033 """) | 3032 """) |
| 3034 | 3033 |
| 3035 def test_rfc2231_get_content_charset(self): | 3034 def test_rfc2231_get_content_charset(self): |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3280 | 3279 |
| 3281 | 3280 |
| 3282 def test_main(): | 3281 def test_main(): |
| 3283 for testclass in _testclasses(): | 3282 for testclass in _testclasses(): |
| 3284 run_unittest(testclass) | 3283 run_unittest(testclass) |
| 3285 | 3284 |
| 3286 | 3285 |
| 3287 | 3286 |
| 3288 if __name__ == '__main__': | 3287 if __name__ == '__main__': |
| 3289 unittest.main(defaultTest='suite') | 3288 unittest.main(defaultTest='suite') |
| OLD | NEW |