From: R David Murray Date: Sun, 9 Mar 2014 19:29:24 +0000 (-0400) Subject: #20871: improve email policy test coverage. X-Git-Tag: v3.4.1rc1~233^2~104 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8bf9951ad294398a7fb95d2fbbf79182c6a0920;p=thirdparty%2FPython%2Fcpython.git #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. --- diff --git a/Lib/test/test_email/test_policy.py b/Lib/test/test_email/test_policy.py index 06ad5f24b80d..e797f36b72ed 100644 --- a/Lib/test/test_email/test_policy.py +++ b/Lib/test/test_email/test_policy.py @@ -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() diff --git a/Misc/ACKS b/Misc/ACKS index 9c559ec238c3..2ed4199920bc 100644 --- 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