Mercurial > p > roundup > code
comparison test/test_mailgw.py @ 4981:7f8f27ce1a06
Remove rfc2822.py
A majority of the module is not being used, and the one function that is
being used can easily be replicated in mailgw.py, meaning that
everything related to the rfc2822 module can be removed.
| author | John Kristensen <john@jerrykan.com> |
|---|---|
| date | Sun, 11 May 2014 01:05:58 +1000 |
| parents | f1a2bd1dea77 |
| children | 868db43b302a |
comparison
equal
deleted
inserted
replaced
| 4980:13f8f88ad984 | 4981:7f8f27ce1a06 |
|---|---|
| 28 SENDMAILDEBUG = os.environ['SENDMAILDEBUG'] | 28 SENDMAILDEBUG = os.environ['SENDMAILDEBUG'] |
| 29 | 29 |
| 30 from roundup import mailgw, i18n, roundupdb | 30 from roundup import mailgw, i18n, roundupdb |
| 31 from roundup.mailgw import MailGW, Unauthorized, uidFromAddress, \ | 31 from roundup.mailgw import MailGW, Unauthorized, uidFromAddress, \ |
| 32 parseContent, IgnoreLoop, IgnoreBulk, MailUsageError, MailUsageHelp | 32 parseContent, IgnoreLoop, IgnoreBulk, MailUsageError, MailUsageHelp |
| 33 from roundup import init, instance, password, rfc2822, __version__ | 33 from roundup import init, instance, password, __version__ |
| 34 from roundup.anypy.sets_ import set | 34 from roundup.anypy.sets_ import set |
| 35 | 35 |
| 36 #import db_test_base | 36 #import db_test_base |
| 37 import memorydb | 37 import memorydb |
| 38 | 38 |
| 2531 self.assertEqual(uidFromAddress(self.db, ('', 'USER1@bar.com'), 0), 0) | 2531 self.assertEqual(uidFromAddress(self.db, ('', 'USER1@bar.com'), 0), 0) |
| 2532 | 2532 |
| 2533 def testUserCreate(self): | 2533 def testUserCreate(self): |
| 2534 i = uidFromAddress(self.db, ('', 'user@foo.com'), 1) | 2534 i = uidFromAddress(self.db, ('', 'user@foo.com'), 1) |
| 2535 self.assertNotEqual(uidFromAddress(self.db, ('', 'user@bar.com'), 1), i) | 2535 self.assertNotEqual(uidFromAddress(self.db, ('', 'user@bar.com'), 1), i) |
| 2536 | |
| 2537 def testRFC2822(self): | |
| 2538 ascii_header = "[issue243] This is a \"test\" - with 'quotation' marks" | |
| 2539 unicode_header = '[issue244] \xd0\xb0\xd0\xbd\xd0\xb4\xd1\x80\xd0\xb5\xd0\xb9' | |
| 2540 unicode_encoded = '=?utf-8?q?[issue244]_=D0=B0=D0=BD=D0=B4=D1=80=D0=B5=D0=B9?=' | |
| 2541 self.assertEqual(rfc2822.encode_header(ascii_header), ascii_header) | |
| 2542 self.assertEqual(rfc2822.encode_header(unicode_header), unicode_encoded) | |
| 2543 | 2536 |
| 2544 def testRegistrationConfirmation(self): | 2537 def testRegistrationConfirmation(self): |
| 2545 otk = "Aj4euk4LZSAdwePohj90SME5SpopLETL" | 2538 otk = "Aj4euk4LZSAdwePohj90SME5SpopLETL" |
| 2546 self.db.getOTKManager().set(otk, username='johannes') | 2539 self.db.getOTKManager().set(otk, username='johannes') |
| 2547 self._handle_mail('''Content-Type: text/plain; | 2540 self._handle_mail('''Content-Type: text/plain; |
