test_get_param_with_semis_in_quotes(): Test case for SF bug #794466.

Backport candidate.
This commit is contained in:
Barry Warsaw 2003-09-03 04:10:52 +00:00
parent 2f5bf17579
commit 2e31ce2514
1 changed files with 7 additions and 0 deletions

View File

@ -313,6 +313,13 @@ class TestMessageAPI(TestEmailBase):
msg = self._msgobj('msg_22.txt')
self.assertEqual(msg.get_payload(1).get_param('name'), 'wibble.JPG')
def test_get_param_with_semis_in_quotes(self):
msg = email.message_from_string(
'Content-Type: image/pjpeg; name="Jim&&Jill"\n')
self.assertEqual(msg.get_param('name'), 'Jim&&Jill')
self.assertEqual(msg.get_param('name', unquote=False),
'"Jim&&Jill"')
def test_has_key(self):
msg = email.message_from_string('Header: exists')
self.failUnless(msg.has_key('header'))