mirror of
https://github.com/python/cpython.git
synced 2025-12-31 12:33:28 +00:00
#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:
parent
1d342b2e8b
commit
b8bf9951ad
2 changed files with 10 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -951,6 +951,7 @@ Aaron Oakley
|
|||
James Oakley
|
||||
Elena Oat
|
||||
Jon Oberheide
|
||||
Milan Oberkirch
|
||||
Pascal Oberndoerfer
|
||||
Jeffrey Ollie
|
||||
Adam Olsen
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue