]> granicus.if.org Git - python/commitdiff
#20871: improve email policy test coverage.
authorR David Murray <rdmurray@bitdance.com>
Sun, 9 Mar 2014 19:29:24 +0000 (15:29 -0400)
committerR David Murray <rdmurray@bitdance.com>
Sun, 9 Mar 2014 19:29:24 +0000 (15:29 -0400)
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.

Lib/test/test_email/test_policy.py
Misc/ACKS

index 06ad5f24b80d65584be1f8b8171d194198f85d96..e797f36b72ed3aa6a852d9a6439d41000ea44162 100644 (file)
@@ -319,5 +319,14 @@ class TestPolicyPropagation(unittest.TestCase):
         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@foo.py')
+
+
 if __name__ == '__main__':
     unittest.main()
index 9c559ec238c33883c1e544af3c458e316c6de91e..2ed4199920bc94e9bd3def4e7d69d9050d778169 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -951,6 +951,7 @@ Aaron Oakley
 James Oakley
 Elena Oat
 Jon Oberheide
+Milan Oberkirch
 Pascal Oberndoerfer
 Jeffrey Ollie
 Adam Olsen