[Python-checkins] cpython: #20871: improve email policy test coverage.

r.david.murray python-checkins at python.org
Sun Mar 9 20:30:34 CET 2014


http://hg.python.org/cpython/rev/8f7486263212
changeset:   89533:8f7486263212
user:        R David Murray <rdmurray at bitdance.com>
date:        Sun Mar 09 15:29:24 2014 -0400
summary:
  #20871: improve email policy test coverage.

More tests of the concrete policy methods would probably be
a good idea, but this is a start, and it brings line coverage
up to 100% for the policy module.

Patch by Milan Oberkirch.

files:
  Lib/test/test_email/test_policy.py |  9 +++++++++
  Misc/ACKS                          |  1 +
  2 files changed, 10 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_email/test_policy.py b/Lib/test/test_email/test_policy.py
--- a/Lib/test/test_email/test_policy.py
+++ b/Lib/test/test_email/test_policy.py
@@ -319,5 +319,14 @@
         self.assertEqual(msg.as_string(), "Subject: testXTo: fooXX")
 
 
+class TestConcretePolicies(unittest.TestCase):
+
+    def test_header_store_parse_rejects_newlines(self):
+        instance = email.policy.EmailPolicy()
+        self.assertRaises(ValueError,
+                          instance.header_store_parse,
+                          'From', 'spam\negg at foo.py')
+
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -951,6 +951,7 @@
 James Oakley
 Elena Oat
 Jon Oberheide
+Milan Oberkirch
 Pascal Oberndoerfer
 Jeffrey Ollie
 Adam Olsen

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list