forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for pythonGH-104802: register a defect instead of raising an e…
…rror Based on PR review
- Loading branch information
1 parent
bf6d7b5
commit a614ff1
Showing
2 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2588,10 +2588,21 @@ def test_get_msg_id_empty(self): | |
with self.assertRaises(errors.HeaderParseError): | ||
parser.get_msg_id('') | ||
|
||
def test_get_msg_id_botched(self): | ||
# gh-105802: ditto for broken Microsoft Message-Id | ||
with self.assertRaises(errors.HeaderParseError): | ||
parser.get_msg_id('<[83c48dddbea7492e873224a5ae1c04be-JFBVALKQOJXWILKNK4YVA7CBPJ2XEZKEMV3E64DTPRCW2YLJNR6EK6DPKNWXI4A=@microsoft.com]>') | ||
def test_get_msg_id_square_brackets(self): | ||
# gh-105802: test for broken Microsoft Message-Id with square brackets. | ||
msg_id = self._test_get_x( | ||
parser.get_msg_id, | ||
'<[[email protected]]>', | ||
'<', # sic | ||
'<', # sic | ||
# This also triggers | ||
# ObsoleteHeaderDefect('obsolete id-left in msg-id') | ||
# and InvalidHeaderDefect('msg-id with no id-right') | ||
[errors.ObsoleteHeaderDefect, errors.InvalidHeaderDefect, | ||
errors.InvalidHeaderDefect], | ||
'[[email protected]]>', | ||
) | ||
self.assertEqual(msg_id.token_type,'msg-id') | ||
|
||
def test_get_msg_id_valid(self): | ||
msg_id = self._test_get_x( | ||
|