diff options
author | R David Murray <rdmurray@bitdance.com> | 2014-03-09 19:29:24 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2014-03-09 19:29:24 (GMT) |
commit | b8bf9951ad294398a7fb95d2fbbf79182c6a0920 (patch) | |
tree | 1d5e62449b9f05670be7f97e29553f90bb91e90e /Lib/test/test_email | |
parent | 1d342b2e8b4a74e823bec4cd5653da63f545955f (diff) | |
download | cpython-b8bf9951ad294398a7fb95d2fbbf79182c6a0920.zip cpython-b8bf9951ad294398a7fb95d2fbbf79182c6a0920.tar.gz cpython-b8bf9951ad294398a7fb95d2fbbf79182c6a0920.tar.bz2 |
#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.
Diffstat (limited to 'Lib/test/test_email')
-rw-r--r-- | Lib/test/test_email/test_policy.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_email/test_policy.py b/Lib/test/test_email/test_policy.py index 06ad5f2..e797f36 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() |