Mercurial > p > roundup > code
comparison test/test_mailgw.py @ 1383:f19dde90e473
applied unicode patch
| author | Andrey Lebedev <kedder@users.sourceforge.net> |
|---|---|
| date | Wed, 15 Jan 2003 22:17:20 +0000 |
| parents | 58d129ad1050 |
| children | 8dc60d87ab42 |
comparison
equal
deleted
inserted
replaced
| 1382:87143c3d7156 | 1383:f19dde90e473 |
|---|---|
| 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.37 2002-12-18 00:42:03 richard Exp $ | 11 # $Id: test_mailgw.py,v 1.38 2003-01-15 22:17:20 kedder 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 |
| 195 handler.main(message) | 195 handler.main(message) |
| 196 | 196 |
| 197 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | 197 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), |
| 198 '''FROM: roundup-admin@your.tracker.email.domain.example | 198 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 199 TO: chef@bork.bork.bork, mary@test, richard@test | 199 TO: chef@bork.bork.bork, mary@test, richard@test |
| 200 Content-Type: text/plain | 200 Content-Type: text/plain; charset=utf-8 |
| 201 Subject: [issue1] Testing... | 201 Subject: [issue1] Testing... |
| 202 To: chef@bork.bork.bork, mary@test, richard@test | 202 To: chef@bork.bork.bork, mary@test, richard@test |
| 203 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example> | 203 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example> |
| 204 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 204 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 205 MIME-Version: 1.0 | 205 MIME-Version: 1.0 |
| 251 handler.trapExceptions = 0 | 251 handler.trapExceptions = 0 |
| 252 handler.main(message) | 252 handler.main(message) |
| 253 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | 253 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), |
| 254 '''FROM: roundup-admin@your.tracker.email.domain.example | 254 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 255 TO: chef@bork.bork.bork, richard@test | 255 TO: chef@bork.bork.bork, richard@test |
| 256 Content-Type: text/plain | 256 Content-Type: text/plain; charset=utf-8 |
| 257 Subject: [issue1] Testing... | 257 Subject: [issue1] Testing... |
| 258 To: chef@bork.bork.bork, richard@test | 258 To: chef@bork.bork.bork, richard@test |
| 259 From: "Contrary, Mary" <issue_tracker@your.tracker.email.domain.example> | 259 From: "Contrary, Mary" <issue_tracker@your.tracker.email.domain.example> |
| 260 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 260 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 261 MIME-Version: 1.0 | 261 MIME-Version: 1.0 |
| 300 self.assertEqual(l, ['3', '4', '5', '6']) | 300 self.assertEqual(l, ['3', '4', '5', '6']) |
| 301 | 301 |
| 302 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | 302 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), |
| 303 '''FROM: roundup-admin@your.tracker.email.domain.example | 303 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 304 TO: chef@bork.bork.bork, john@test, mary@test | 304 TO: chef@bork.bork.bork, john@test, mary@test |
| 305 Content-Type: text/plain | 305 Content-Type: text/plain; charset=utf-8 |
| 306 Subject: [issue1] Testing... | 306 Subject: [issue1] Testing... |
| 307 To: chef@bork.bork.bork, john@test, mary@test | 307 To: chef@bork.bork.bork, john@test, mary@test |
| 308 From: richard <issue_tracker@your.tracker.email.domain.example> | 308 From: richard <issue_tracker@your.tracker.email.domain.example> |
| 309 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 309 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 310 MIME-Version: 1.0 | 310 MIME-Version: 1.0 |
| 347 handler.main(message) | 347 handler.main(message) |
| 348 | 348 |
| 349 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | 349 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), |
| 350 '''FROM: roundup-admin@your.tracker.email.domain.example | 350 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 351 TO: chef@bork.bork.bork, john@test, mary@test | 351 TO: chef@bork.bork.bork, john@test, mary@test |
| 352 Content-Type: text/plain | 352 Content-Type: text/plain; charset=utf-8 |
| 353 Subject: [issue1] Testing... | 353 Subject: [issue1] Testing... |
| 354 To: chef@bork.bork.bork, john@test, mary@test | 354 To: chef@bork.bork.bork, john@test, mary@test |
| 355 From: richard <issue_tracker@your.tracker.email.domain.example> | 355 From: richard <issue_tracker@your.tracker.email.domain.example> |
| 356 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 356 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 357 MIME-Version: 1.0 | 357 MIME-Version: 1.0 |
| 395 handler.main(message) | 395 handler.main(message) |
| 396 | 396 |
| 397 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | 397 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), |
| 398 '''FROM: roundup-admin@your.tracker.email.domain.example | 398 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 399 TO: chef@bork.bork.bork, richard@test | 399 TO: chef@bork.bork.bork, richard@test |
| 400 Content-Type: text/plain | 400 Content-Type: text/plain; charset=utf-8 |
| 401 Subject: [issue1] Testing... | 401 Subject: [issue1] Testing... |
| 402 To: chef@bork.bork.bork, richard@test | 402 To: chef@bork.bork.bork, richard@test |
| 403 From: John Doe <issue_tracker@your.tracker.email.domain.example> | 403 From: John Doe <issue_tracker@your.tracker.email.domain.example> |
| 404 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 404 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 405 MIME-Version: 1.0 | 405 MIME-Version: 1.0 |
| 444 handler.main(message) | 444 handler.main(message) |
| 445 | 445 |
| 446 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | 446 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), |
| 447 '''FROM: roundup-admin@your.tracker.email.domain.example | 447 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 448 TO: chef@bork.bork.bork | 448 TO: chef@bork.bork.bork |
| 449 Content-Type: text/plain | 449 Content-Type: text/plain; charset=utf-8 |
| 450 Subject: [issue1] Testing... | 450 Subject: [issue1] Testing... |
| 451 To: chef@bork.bork.bork | 451 To: chef@bork.bork.bork |
| 452 From: richard <issue_tracker@your.tracker.email.domain.example> | 452 From: richard <issue_tracker@your.tracker.email.domain.example> |
| 453 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 453 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 454 MIME-Version: 1.0 | 454 MIME-Version: 1.0 |
| 493 handler.main(message) | 493 handler.main(message) |
| 494 | 494 |
| 495 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | 495 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), |
| 496 '''FROM: roundup-admin@your.tracker.email.domain.example | 496 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 497 TO: chef@bork.bork.bork, john@test, richard@test | 497 TO: chef@bork.bork.bork, john@test, richard@test |
| 498 Content-Type: text/plain | 498 Content-Type: text/plain; charset=utf-8 |
| 499 Subject: [issue1] Testing... | 499 Subject: [issue1] Testing... |
| 500 To: chef@bork.bork.bork, john@test, richard@test | 500 To: chef@bork.bork.bork, john@test, richard@test |
| 501 From: John Doe <issue_tracker@your.tracker.email.domain.example> | 501 From: John Doe <issue_tracker@your.tracker.email.domain.example> |
| 502 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 502 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 503 MIME-Version: 1.0 | 503 MIME-Version: 1.0 |
| 541 handler.main(message) | 541 handler.main(message) |
| 542 | 542 |
| 543 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | 543 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), |
| 544 '''FROM: roundup-admin@your.tracker.email.domain.example | 544 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 545 TO: chef@bork.bork.bork, richard@test | 545 TO: chef@bork.bork.bork, richard@test |
| 546 Content-Type: text/plain | 546 Content-Type: text/plain; charset=utf-8 |
| 547 Subject: [issue1] Testing... | 547 Subject: [issue1] Testing... |
| 548 To: chef@bork.bork.bork, richard@test | 548 To: chef@bork.bork.bork, richard@test |
| 549 From: John Doe <issue_tracker@your.tracker.email.domain.example> | 549 From: John Doe <issue_tracker@your.tracker.email.domain.example> |
| 550 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 550 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 551 MIME-Version: 1.0 | 551 MIME-Version: 1.0 |
| 589 handler.main(message) | 589 handler.main(message) |
| 590 | 590 |
| 591 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | 591 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), |
| 592 '''FROM: roundup-admin@your.tracker.email.domain.example | 592 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 593 TO: chef@bork.bork.bork | 593 TO: chef@bork.bork.bork |
| 594 Content-Type: text/plain | 594 Content-Type: text/plain; charset=utf-8 |
| 595 Subject: [issue1] Testing... | 595 Subject: [issue1] Testing... |
| 596 To: chef@bork.bork.bork | 596 To: chef@bork.bork.bork |
| 597 From: richard <issue_tracker@your.tracker.email.domain.example> | 597 From: richard <issue_tracker@your.tracker.email.domain.example> |
| 598 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 598 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 599 MIME-Version: 1.0 | 599 MIME-Version: 1.0 |
| 698 handler.trapExceptions = 0 | 698 handler.trapExceptions = 0 |
| 699 handler.main(message) | 699 handler.main(message) |
| 700 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | 700 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), |
| 701 '''FROM: roundup-admin@your.tracker.email.domain.example | 701 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 702 TO: chef@bork.bork.bork, richard@test | 702 TO: chef@bork.bork.bork, richard@test |
| 703 Content-Type: text/plain | 703 Content-Type: text/plain; charset=utf-8 |
| 704 Subject: [issue1] Testing... | 704 Subject: [issue1] Testing... |
| 705 To: chef@bork.bork.bork, richard@test | 705 To: chef@bork.bork.bork, richard@test |
| 706 From: "Contrary, Mary" <issue_tracker@your.tracker.email.domain.example> | 706 From: "Contrary, Mary" <issue_tracker@your.tracker.email.domain.example> |
| 707 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 707 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 708 MIME-Version: 1.0 | 708 MIME-Version: 1.0 |
| 713 Content-Transfer-Encoding: quoted-printable | 713 Content-Transfer-Encoding: quoted-printable |
| 714 | 714 |
| 715 | 715 |
| 716 Contrary, Mary <mary@test> added the comment: | 716 Contrary, Mary <mary@test> added the comment: |
| 717 | 717 |
| 718 A message with encoding (encoded oe =F6) | 718 A message with encoding (encoded oe =C3=B6) |
| 719 | 719 |
| 720 ---------- | 720 ---------- |
| 721 status: unread -> chatting | 721 status: unread -> chatting |
| 722 _______________________________________________________________________ | 722 _______________________________________________________________________ |
| 723 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 723 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 753 handler.trapExceptions = 0 | 753 handler.trapExceptions = 0 |
| 754 handler.main(message) | 754 handler.main(message) |
| 755 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | 755 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), |
| 756 '''FROM: roundup-admin@your.tracker.email.domain.example | 756 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 757 TO: chef@bork.bork.bork, richard@test | 757 TO: chef@bork.bork.bork, richard@test |
| 758 Content-Type: text/plain | 758 Content-Type: text/plain; charset=utf-8 |
| 759 Subject: [issue1] Testing... | 759 Subject: [issue1] Testing... |
| 760 To: chef@bork.bork.bork, richard@test | 760 To: chef@bork.bork.bork, richard@test |
| 761 From: "Contrary, Mary" <issue_tracker@your.tracker.email.domain.example> | 761 From: "Contrary, Mary" <issue_tracker@your.tracker.email.domain.example> |
| 762 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 762 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 763 MIME-Version: 1.0 | 763 MIME-Version: 1.0 |
| 768 Content-Transfer-Encoding: quoted-printable | 768 Content-Transfer-Encoding: quoted-printable |
| 769 | 769 |
| 770 | 770 |
| 771 Contrary, Mary <mary@test> added the comment: | 771 Contrary, Mary <mary@test> added the comment: |
| 772 | 772 |
| 773 A message with first part encoded (encoded oe =F6) | 773 A message with first part encoded (encoded oe =C3=B6) |
| 774 | 774 |
| 775 ---------- | 775 ---------- |
| 776 status: unread -> chatting | 776 status: unread -> chatting |
| 777 _______________________________________________________________________ | 777 _______________________________________________________________________ |
| 778 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 778 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 798 handler.main(message) | 798 handler.main(message) |
| 799 | 799 |
| 800 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), | 800 self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), |
| 801 '''FROM: roundup-admin@your.tracker.email.domain.example | 801 '''FROM: roundup-admin@your.tracker.email.domain.example |
| 802 TO: chef@bork.bork.bork | 802 TO: chef@bork.bork.bork |
| 803 Content-Type: text/plain | 803 Content-Type: text/plain; charset=utf-8 |
| 804 Subject: [issue1] Testing... | 804 Subject: [issue1] Testing... |
| 805 To: chef@bork.bork.bork | 805 To: chef@bork.bork.bork |
| 806 From: richard <issue_tracker@your.tracker.email.domain.example> | 806 From: richard <issue_tracker@your.tracker.email.domain.example> |
| 807 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 807 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 808 MIME-Version: 1.0 | 808 MIME-Version: 1.0 |
