Mercurial > p > roundup > code
comparison test/test_mailgw.py @ 1222:bc3bc3248dd1
added Class.find() unit test, fixed implementations
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 26 Sep 2002 03:04:24 +0000 |
| parents | bd3b57859c37 |
| children | b2d04ce03802 |
comparison
equal
deleted
inserted
replaced
| 1221:778297033003 | 1222:bc3bc3248dd1 |
|---|---|
| 6 # | 6 # |
| 7 # This module is distributed in the hope that it will be useful, | 7 # This module is distributed in the hope that it will be useful, |
| 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 10 # | 10 # |
| 11 # $Id: test_mailgw.py,v 1.31 2002-09-20 05:08:00 richard Exp $ | 11 # $Id: test_mailgw.py,v 1.32 2002-09-26 03:04:24 richard Exp $ |
| 12 | 12 |
| 13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib | 13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib |
| 14 | 14 |
| 15 # Note: Should parse emails according to RFC2822 instead of performing a | 15 # Note: Should parse emails according to RFC2822 instead of performing a |
| 16 # literal string comparision. Parsing the messages allows the tests to work for | 16 # literal string comparision. Parsing the messages allows the tests to work for |
| 771 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example> | 771 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example> |
| 772 http://your.tracker.url.example/issue1 | 772 http://your.tracker.url.example/issue1 |
| 773 _________________________________________________________________________ | 773 _________________________________________________________________________ |
| 774 ''') | 774 ''') |
| 775 | 775 |
| 776 def testFollowupStupidQuoting(self): | |
| 777 self.doNewIssue() | |
| 778 | |
| 779 message = cStringIO.StringIO('''Content-Type: text/plain; | |
| 780 charset="iso-8859-1" | |
| 781 From: richard <richard@test> | |
| 782 To: issue_tracker@your.tracker.email.domain.example | |
| 783 Message-Id: <followup_dummy_id> | |
| 784 In-Reply-To: <dummy_test_message_id> | |
| 785 Subject: Re: "[issue1] Testing... " | |
| 786 | |
| 787 This is a followup | |
| 788 ''') | |
| 789 handler = self.instance.MailGW(self.instance, self.db) | |
| 790 handler.trapExceptions = 0 | |
| 791 handler.main(message) | |
| 792 | |
| 793 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | |
| 794 '''FROM: roundup-admin@your.tracker.email.domain.example | |
| 795 TO: chef@bork.bork.bork | |
| 796 Content-Type: text/plain | |
| 797 Subject: [issue1] Testing... | |
| 798 To: chef@bork.bork.bork | |
| 799 From: "richard" <issue_tracker@your.tracker.email.domain.example> | |
| 800 Reply-To: "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example> | |
| 801 MIME-Version: 1.0 | |
| 802 Message-Id: <followup_dummy_id> | |
| 803 In-Reply-To: <dummy_test_message_id> | |
| 804 X-Roundup-Name: Roundup issue tracker | |
| 805 Content-Transfer-Encoding: quoted-printable | |
| 806 | |
| 807 | |
| 808 richard <richard@test> added the comment: | |
| 809 | |
| 810 This is a followup | |
| 811 | |
| 812 | |
| 813 ---------- | |
| 814 status: unread -> chatting | |
| 815 _________________________________________________________________________ | |
| 816 "Roundup issue tracker" <issue_tracker@your.tracker.email.domain.example> | |
| 817 http://your.tracker.url.example/issue1 | |
| 818 _________________________________________________________________________ | |
| 819 ''') | |
| 820 | |
| 776 def suite(): | 821 def suite(): |
| 777 l = [unittest.makeSuite(MailgwTestCase), | 822 l = [unittest.makeSuite(MailgwTestCase), |
| 778 ] | 823 ] |
| 779 return unittest.TestSuite(l) | 824 return unittest.TestSuite(l) |
| 780 | 825 |
