Kaydet (Commit) b8bf9951 authored tarafından R David Murray's avatar R David Murray

#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.
üst 1d342b2e
...@@ -319,5 +319,14 @@ class TestPolicyPropagation(unittest.TestCase): ...@@ -319,5 +319,14 @@ class TestPolicyPropagation(unittest.TestCase):
self.assertEqual(msg.as_string(), "Subject: testXTo: fooXX") 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__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -951,6 +951,7 @@ Aaron Oakley ...@@ -951,6 +951,7 @@ Aaron Oakley
James Oakley James Oakley
Elena Oat Elena Oat
Jon Oberheide Jon Oberheide
Milan Oberkirch
Pascal Oberndoerfer Pascal Oberndoerfer
Jeffrey Ollie Jeffrey Ollie
Adam Olsen Adam Olsen
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment