Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8bf995

Browse files
committed
#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.
1 parent 1d342b2 commit b8bf995

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Lib/test/test_email/test_policy.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,5 +319,14 @@ def test_message_policy_used_by_as_string(self):
319319
self.assertEqual(msg.as_string(), "Subject: testXTo: fooXX")
320320

321321

322+
class TestConcretePolicies(unittest.TestCase):
323+
324+
def test_header_store_parse_rejects_newlines(self):
325+
instance = email.policy.EmailPolicy()
326+
self.assertRaises(ValueError,
327+
instance.header_store_parse,
328+
'From', 'spam\n[email protected]')
329+
330+
322331
if __name__ == '__main__':
323332
unittest.main()

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,7 @@ Aaron Oakley
951951
James Oakley
952952
Elena Oat
953953
Jon Oberheide
954+
Milan Oberkirch
954955
Pascal Oberndoerfer
955956
Jeffrey Ollie
956957
Adam Olsen

0 commit comments

Comments
 (0)