forked from marrow/mailer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/4.0.0' into develop
- Loading branch information
Showing
7 changed files
with
32 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,17 @@ | |
|
||
import os | ||
import sys | ||
import warnings | ||
|
||
from setuptools import setup, find_packages | ||
|
||
|
||
if sys.version_info < (2, 6): | ||
raise SystemExit("Python 2.6 or later is required.") | ||
|
||
if sys.version_info > (3, 0): | ||
warnings.warn("Marrow Mailer is untested on Python 3; some features may be broken.", RuntimeWarning) | ||
|
||
exec(open(os.path.join("marrow", "mailer", "release.py")).read()) | ||
|
||
|
||
|
@@ -27,7 +31,7 @@ | |
|
||
author = "Alice Bevan-McGregor", | ||
author_email = "[email protected]", | ||
url = "https://github.com/marrow/marrow.wsgi.objects", | ||
url = "https://github.com/marrow/marrow.mailer", | ||
license = "MIT", | ||
|
||
install_requires = [ | ||
|
@@ -42,20 +46,22 @@ | |
'PyDNS', | ||
'transaction', | ||
'pymta' | ||
], | ||
] + [ | ||
'futures' | ||
] if sys.version_info < (3, 0) else [], | ||
|
||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 2.6", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.1", | ||
"Programming Language :: Python :: 3.2", | ||
# "Programming Language :: Python :: 3", | ||
# "Programming Language :: Python :: 3.1", | ||
# "Programming Language :: Python :: 3.2", | ||
"Topic :: Software Development :: Libraries :: Python Modules" | ||
], | ||
|
||
|
@@ -71,7 +77,7 @@ | |
'immediate = marrow.mailer.manager.immediate:ImmediateManager', | ||
'futures = marrow.mailer.manager.futures:FuturesManager', | ||
'dynamic = marrow.mailer.manager.dynamic:DynamicManager', | ||
'transactional = marrow.mailer.manager.transactional:TransactionalDynamicManager' | ||
# 'transactional = marrow.mailer.manager.transactional:TransactionalDynamicManager' | ||
], | ||
'marrow.mailer.transport': [ | ||
'amazon = marrow.mailer.transport.ses:AmazonTransport', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,9 +42,9 @@ def test_deprecation(self): | |
|
||
self.assertEqual(len(w), 1, "No, or more than one, warning issued.") | ||
self.assertTrue(issubclass(w[-1].category, DeprecationWarning), "Category of warning is not DeprecationWarning.") | ||
self.assertIn('deprecated', str(w[-1].message), "Warning does not include 'deprecated'.") | ||
self.assertIn('Mailer', str(w[-1].message), "Warning does not include correct class name.") | ||
self.assertIn('Delivery', str(w[-1].message), "Warning does not include old class name.") | ||
self.assertTrue('deprecated' in str(w[-1].message), "Warning does not include 'deprecated'.") | ||
self.assertTrue('Mailer' in str(w[-1].message), "Warning does not include correct class name.") | ||
self.assertTrue('Delivery' in str(w[-1].message), "Warning does not include old class name.") | ||
|
||
def test_use_deprecation(self): | ||
with warnings.catch_warnings(record=True) as w: | ||
|
@@ -55,12 +55,12 @@ def test_use_deprecation(self): | |
self.assertEqual(len(w), 2, "Too few or too many warnings issued.") | ||
|
||
self.assertTrue(issubclass(w[0].category, DeprecationWarning), "Category of warning is not DeprecationWarning.") | ||
self.assertIn('deprecated', str(w[0].message), "Warning does not include 'deprecated'.") | ||
self.assertIn('manager.use', str(w[0].message), "Warning does not include correct use.") | ||
self.assertTrue('deprecated' in str(w[0].message), "Warning does not include 'deprecated'.") | ||
self.assertTrue('manager.use' in str(w[0].message), "Warning does not include correct use.") | ||
|
||
self.assertTrue(issubclass(w[1].category, DeprecationWarning), "Category of warning is not DeprecationWarning.") | ||
self.assertIn('deprecated', str(w[1].message), "Warning does not include 'deprecated'.") | ||
self.assertIn('transport.use', str(w[1].message), "Warning does not include correct use.") | ||
self.assertTrue('deprecated' in str(w[1].message), "Warning does not include 'deprecated'.") | ||
self.assertTrue('transport.use' in str(w[1].message), "Warning does not include correct use.") | ||
|
||
def test_standard(self): | ||
log.info("Testing configuration: %r", dict(base_config)) | ||
|
@@ -225,7 +225,7 @@ def test_new(self): | |
self.assertEqual(message.author, ["[email protected]"]) | ||
self.assertEqual(message.bcc, []) | ||
self.assertEqual(message.retries, 2) | ||
self.assertIs(message.mailer, interface) | ||
self.assertTrue(message.mailer is interface) | ||
self.assertEqual(message.brand, False) | ||
|
||
self.assertRaises(NotImplementedError, Message().send) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
log = logging.getLogger('tests') | ||
|
||
|
||
|
||
class TestMailDirectoryTransport(TestCase): | ||
def setUp(self): | ||
self.path = tempfile.mkdtemp() | ||
|
@@ -38,7 +39,7 @@ def test_bad_config(self): | |
|
||
def test_startup(self): | ||
self.transport.startup() | ||
self.assertIsInstance(self.transport.box, mailbox.Maildir) | ||
self.assertTrue(isinstance(self.transport.box, mailbox.Maildir)) | ||
|
||
def test_child_folder_startup(self): | ||
self.transport.folder = 'test' | ||
|
@@ -48,7 +49,7 @@ def test_child_folder_startup(self): | |
def test_shutdown(self): | ||
self.transport.startup() | ||
self.transport.shutdown() | ||
self.assertIsNone(self.transport.box) | ||
self.assertTrue(self.transport.box is None) | ||
|
||
def test_delivery(self): | ||
message = Message('[email protected]', '[email protected]', "Test subject.") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,12 +36,12 @@ def test_bad_config(self): | |
|
||
def test_startup(self): | ||
self.transport.startup() | ||
self.assertIsInstance(self.transport.box, mailbox.mbox) | ||
self.assertTrue(isinstance(self.transport.box, mailbox.mbox)) | ||
|
||
def test_shutdown(self): | ||
self.transport.startup() | ||
self.transport.shutdown() | ||
self.assertIsNone(self.transport.box) | ||
self.assertTrue(self.transport.box is None) | ||
|
||
def test_delivery(self): | ||
message = Message('[email protected]', '[email protected]', "Test subject.") | ||
|