diff options
Diffstat (limited to 'src/mailman/rules/tests')
| -rw-r--r-- | src/mailman/rules/tests/test_no_subject.py | 9 | ||||
| -rw-r--r-- | src/mailman/rules/tests/test_suspicious.py | 7 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/mailman/rules/tests/test_no_subject.py b/src/mailman/rules/tests/test_no_subject.py index efe942af6..0155e25ee 100644 --- a/src/mailman/rules/tests/test_no_subject.py +++ b/src/mailman/rules/tests/test_no_subject.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015 by the Free Software Foundation, Inc. +# Copyright (C) 2016 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # @@ -17,7 +17,6 @@ """Test the `no_subject` header rule.""" - import unittest from email.header import Header @@ -37,15 +36,13 @@ class TestNoSubject(unittest.TestCase): self._rule = no_subject.NoSubject() def test_header_instance_empty(self): - # Check the case where the subject is a Header instance msg = Message() - msg["Subject"] = Header("") + msg['Subject'] = Header('') result = self._rule.check(self._mlist, msg, {}) self.assertTrue(result) def test_header_instance_not_empty(self): - # Check the case where the subject is a Header instance msg = Message() - msg["Subject"] = Header("Test subject") + msg['Subject'] = Header('Test subject') result = self._rule.check(self._mlist, msg, {}) self.assertFalse(result) diff --git a/src/mailman/rules/tests/test_suspicious.py b/src/mailman/rules/tests/test_suspicious.py index e1649928c..441fb0b48 100644 --- a/src/mailman/rules/tests/test_suspicious.py +++ b/src/mailman/rules/tests/test_suspicious.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015 by the Free Software Foundation, Inc. +# Copyright (C) 2016 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # @@ -28,7 +28,7 @@ from mailman.testing.layers import ConfigLayer class TestSuspicious(unittest.TestCase): - """Test the suspicous rule.""" + """Test the suspicious rule.""" layer = ConfigLayer @@ -37,9 +37,8 @@ class TestSuspicious(unittest.TestCase): self._rule = suspicious.SuspiciousHeader() def test_header_instance(self): - # Check the case where the subject is a Header instance msg = Message() - msg["From"] = Header("user@example.com") + msg['From'] = Header('user@example.com') self._mlist.bounce_matching_headers = 'from: spam@example.com' result = self._rule.check(self._mlist, msg, {}) self.assertFalse(result) |
