mirror of https://github.com/python/cpython
#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
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue