MCPcopy Index your code
hub / github.com/python/cpython / test_del_param

Method test_del_param

Lib/test/test_email/test_email.py:5431–5459  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5429 self.assertEqual(msg['content-type'], 'text/plain; title="(bar)bell"')
5430
5431 def test_del_param(self):
5432 eq = self.ndiffAssertEqual
5433 msg = self._msgobj('msg_01.txt')
5434 msg.set_param('foo', 'bar', charset='us-ascii', language='en')
5435 msg.set_param('title', 'This is even more ***fun*** isn\'t it!',
5436 charset='us-ascii', language='en')
5437 msg.del_param('foo', header='Content-Type')
5438 eq(msg.as_string(maxheaderlen=78), """\
5439Return-Path: <bbb@zzz.org>
5440Delivered-To: bbb@zzz.org
5441Received: by mail.zzz.org (Postfix, from userid 889)
5442\tid 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT)
5443MIME-Version: 1.0
5444Content-Transfer-Encoding: 7bit
5445Message-ID: <15090.61304.110929.45684@aaa.zzz.org>
5446From: bbb@ddd.com (John X. Doe)
5447To: bbb@zzz.org
5448Subject: This is a test message
5449Date: Fri, 4 May 2001 14:05:44 -0400
5450Content-Type: text/plain; charset="us-ascii";
5451 title*=us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21
5452
5453
5454Hi,
5455
5456Do you like this message?
5457
5458-Me
5459""")
5460
5461 # test_headerregistry.TestContentTypeHeader.rfc2231_encoded_charset
5462 # I changed the charset name, though, because the one in the file isn't

Callers

nothing calls this directly

Calls 5

eqFunction · 0.85
set_paramMethod · 0.80
del_paramMethod · 0.80
_msgobjMethod · 0.45
as_stringMethod · 0.45

Tested by

no test coverage detected