Mercurial > p > roundup > code
comparison test/test_mailgw.py @ 613:d77b82588bf0
Fixed the unit tests for the mailgw re: the x-roundup-name header.
Also made the test runner more user-friendly:
./run_tests - detect all tests in test/test_<name>.py and run them
./run_tests <name> - run only test/test_<name>.py
eg ./run_tests mailgw - run the mailgw test from test/test_mailgw.py
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 14 Feb 2002 23:38:12 +0000 |
| parents | 633f2b542146 |
| children | 08abec25b2c6 |
comparison
equal
deleted
inserted
replaced
| 612:a2aeebf3d6bd | 613:d77b82588bf0 |
|---|---|
| 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.10 2002-02-12 08:08:55 grubert Exp $ | 11 # $Id: test_mailgw.py,v 1.11 2002-02-14 23:38:12 richard Exp $ |
| 12 | 12 |
| 13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys | 13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys |
| 14 | 14 |
| 15 from roundup.mailgw import MailGW | 15 from roundup.mailgw import MailGW |
| 16 from roundup import init, instance | 16 from roundup import init, instance |
| 84 To: chef@bork.bork.bork, mary@test, richard@test | 84 To: chef@bork.bork.bork, mary@test, richard@test |
| 85 From: Chef <issue_tracker@fill.me.in.> | 85 From: Chef <issue_tracker@fill.me.in.> |
| 86 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> | 86 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> |
| 87 MIME-Version: 1.0 | 87 MIME-Version: 1.0 |
| 88 Message-Id: <dummy_test_message_id> | 88 Message-Id: <dummy_test_message_id> |
| 89 X-Roundup-Name: Roundup issue tracker | |
| 89 | 90 |
| 90 | 91 |
| 91 New submission from Chef <chef@bork.bork.bork>: | 92 New submission from Chef <chef@bork.bork.bork>: |
| 92 | 93 |
| 93 This is a test submission of a new issue. | 94 This is a test submission of a new issue. |
| 111 # see MultipartEnc tests: but if there is more than one part | 112 # see MultipartEnc tests: but if there is more than one part |
| 112 # we return a multipart/mixed and the boundary contains | 113 # we return a multipart/mixed and the boundary contains |
| 113 # the ip address of the test machine. | 114 # the ip address of the test machine. |
| 114 | 115 |
| 115 # BUG should test some binary attamchent too. | 116 # BUG should test some binary attamchent too. |
| 116 | 117 |
| 117 def testFollowup(self): | 118 def testFollowup(self): |
| 118 self.testNewIssue() | 119 self.testNewIssue() |
| 119 message = cStringIO.StringIO('''Content-Type: text/plain; | 120 message = cStringIO.StringIO('''Content-Type: text/plain; |
| 120 charset="iso-8859-1" | 121 charset="iso-8859-1" |
| 121 From: richard <richard@test> | 122 From: richard <richard@test> |
| 138 From: richard <issue_tracker@fill.me.in.> | 139 From: richard <issue_tracker@fill.me.in.> |
| 139 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> | 140 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> |
| 140 MIME-Version: 1.0 | 141 MIME-Version: 1.0 |
| 141 Message-Id: <followup_dummy_id> | 142 Message-Id: <followup_dummy_id> |
| 142 In-Reply-To: <dummy_test_message_id> | 143 In-Reply-To: <dummy_test_message_id> |
| 144 X-Roundup-Name: Roundup issue tracker | |
| 143 | 145 |
| 144 | 146 |
| 145 richard <richard@test> added the comment: | 147 richard <richard@test> added the comment: |
| 146 | 148 |
| 147 This is a followup | 149 This is a followup |
| 180 From: mary <issue_tracker@fill.me.in.> | 182 From: mary <issue_tracker@fill.me.in.> |
| 181 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> | 183 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> |
| 182 MIME-Version: 1.0 | 184 MIME-Version: 1.0 |
| 183 Message-Id: <followup_dummy_id> | 185 Message-Id: <followup_dummy_id> |
| 184 In-Reply-To: <dummy_test_message_id> | 186 In-Reply-To: <dummy_test_message_id> |
| 187 X-Roundup-Name: Roundup issue tracker | |
| 185 | 188 |
| 186 | 189 |
| 187 mary <mary@test> added the comment: | 190 mary <mary@test> added the comment: |
| 188 | 191 |
| 189 This is a second followup | 192 This is a second followup |
| 225 From: mary <issue_tracker@fill.me.in.> | 228 From: mary <issue_tracker@fill.me.in.> |
| 226 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> | 229 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> |
| 227 MIME-Version: 1.0 | 230 MIME-Version: 1.0 |
| 228 Message-Id: <followup_dummy_id> | 231 Message-Id: <followup_dummy_id> |
| 229 In-Reply-To: <dummy_test_message_id> | 232 In-Reply-To: <dummy_test_message_id> |
| 233 X-Roundup-Name: Roundup issue tracker | |
| 230 | 234 |
| 231 | 235 |
| 232 mary <mary@test> added the comment: | 236 mary <mary@test> added the comment: |
| 233 | 237 |
| 234 A message with encoding (encoded oe ö) | 238 A message with encoding (encoded oe ö) |
| 277 From: mary <issue_tracker@fill.me.in.> | 281 From: mary <issue_tracker@fill.me.in.> |
| 278 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> | 282 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.> |
| 279 MIME-Version: 1.0 | 283 MIME-Version: 1.0 |
| 280 Message-Id: <followup_dummy_id> | 284 Message-Id: <followup_dummy_id> |
| 281 In-Reply-To: <dummy_test_message_id> | 285 In-Reply-To: <dummy_test_message_id> |
| 286 X-Roundup-Name: Roundup issue tracker | |
| 282 | 287 |
| 283 | 288 |
| 284 mary <mary@test> added the comment: | 289 mary <mary@test> added the comment: |
| 285 | 290 |
| 286 A message with first part encoded (encoded oe ö) | 291 A message with first part encoded (encoded oe ö) |
| 303 return unittest.TestSuite(l) | 308 return unittest.TestSuite(l) |
| 304 | 309 |
| 305 | 310 |
| 306 # | 311 # |
| 307 # $Log: not supported by cvs2svn $ | 312 # $Log: not supported by cvs2svn $ |
| 313 # Revision 1.10 2002/02/12 08:08:55 grubert | |
| 314 # . Clean up mail handling, multipart handling. | |
| 315 # | |
| 308 # Revision 1.9 2002/02/05 14:15:29 grubert | 316 # Revision 1.9 2002/02/05 14:15:29 grubert |
| 309 # . respect encodings in non multipart messages. | 317 # . respect encodings in non multipart messages. |
| 310 # | 318 # |
| 311 # Revision 1.8 2002/02/04 09:40:21 grubert | 319 # Revision 1.8 2002/02/04 09:40:21 grubert |
| 312 # . add test for multipart messages with first part being encoded. | 320 # . add test for multipart messages with first part being encoded. |
