Mercurial > p > roundup > code
comparison test/test_mailgw.py @ 1409:8dc60d87ab42
Fixed a backlog of bug reports, and worked on python 2.3 compatibility:
- fixed templating filter function arguments [SF#678911]
- fixed multiselect in searching [SF#676874]
- fixed parsing of content-disposition filenames [SF#675116]
- added 'h' to roundup-server optarg list [SF#674070]
- fixed doc for db.history in anydbm and rdbms_common [SF#679221]
- fixed timelog example so it handles new issues [SF#678908]
- handle missing os.fork() [SF#681046]
- fixed roundup-reminder [SF#681042]
- fixed int assumptions about Number values [SF#677762]
- added warning filter for "FutureWarning: hex/oct constants > sys.maxint will
return positive values..." (literal 0xffff0000 in portalocker.py)
- fixed ZPT code generating SyntaxWarning for assignment to None
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 06 Feb 2003 05:43:49 +0000 |
| parents | f19dde90e473 |
| children | ca3e0e2320be |
comparison
equal
deleted
inserted
replaced
| 1408:01c02e81e08d | 1409:8dc60d87ab42 |
|---|---|
| 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.38 2003-01-15 22:17:20 kedder Exp $ | 11 # $Id: test_mailgw.py,v 1.39 2003-02-06 05:43:49 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 |
| 778 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 778 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 779 http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1 | 779 http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1 |
| 780 _______________________________________________________________________ | 780 _______________________________________________________________________ |
| 781 ''') | 781 ''') |
| 782 | 782 |
| 783 def testContentDisposition(self): | |
| 784 self.doNewIssue() | |
| 785 message = cStringIO.StringIO('''Content-Type: text/plain; | |
| 786 charset="iso-8859-1" | |
| 787 From: mary <mary@test> | |
| 788 To: issue_tracker@your.tracker.email.domain.example | |
| 789 Message-Id: <followup_dummy_id> | |
| 790 In-Reply-To: <dummy_test_message_id> | |
| 791 Subject: [issue1] Testing... | |
| 792 Content-Type: multipart/mixed; boundary="bCsyhTFzCvuiizWE" | |
| 793 Content-Disposition: inline | |
| 794 | |
| 795 | |
| 796 --bCsyhTFzCvuiizWE | |
| 797 Content-Type: text/plain; charset=us-ascii | |
| 798 Content-Disposition: inline | |
| 799 | |
| 800 test attachment binary | |
| 801 | |
| 802 --bCsyhTFzCvuiizWE | |
| 803 Content-Type: application/octet-stream | |
| 804 Content-Disposition: attachment; filename="main.dvi" | |
| 805 | |
| 806 xxxxxx | |
| 807 | |
| 808 --bCsyhTFzCvuiizWE-- | |
| 809 ''') | |
| 810 handler = self.instance.MailGW(self.instance, self.db) | |
| 811 handler.trapExceptions = 0 | |
| 812 handler.main(message) | |
| 813 messages = self.db.issue.get('1', 'messages') | |
| 814 messages.sort() | |
| 815 file = self.db.msg.get(messages[-1], 'files')[0] | |
| 816 self.assertEqual(self.db.file.get(file, 'name'), 'main.dvi') | |
| 817 | |
| 783 def testFollowupStupidQuoting(self): | 818 def testFollowupStupidQuoting(self): |
| 784 self.doNewIssue() | 819 self.doNewIssue() |
| 785 | 820 |
| 786 message = cStringIO.StringIO('''Content-Type: text/plain; | 821 message = cStringIO.StringIO('''Content-Type: text/plain; |
| 787 charset="iso-8859-1" | 822 charset="iso-8859-1" |
