#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.
This commit is contained in:
R David Murray 2014-03-09 15:29:24 -04:00
parent 1d342b2e8b
commit b8bf9951ad
2 changed files with 10 additions and 0 deletions

View file

@ -319,5 +319,14 @@ def test_message_policy_used_by_as_string(self):
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()

View file

@ -951,6 +951,7 @@ Aaron Oakley
James Oakley
Elena Oat
Jon Oberheide
Milan Oberkirch
Pascal Oberndoerfer
Jeffrey Ollie
Adam Olsen