MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_del_param

Method test_del_param

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

Source from the content-addressed store, hash-verified

5500 self.assertEqual(msg['content-type'], 'text/plain; title="(bar)bell"')
5501
5502 def test_del_param(self):
5503 eq = self.ndiffAssertEqual
5504 msg = self._msgobj('msg_01.txt')
5505 msg.set_param('foo', 'bar', charset='us-ascii', language='en')
5506 msg.set_param('title', 'This is even more ***fun*** isn\'t it!',
5507 charset='us-ascii', language='en')
5508 msg.del_param('foo', header='Content-Type')
5509 eq(msg.as_string(maxheaderlen=78), """\
5510Return-Path: <bbb@zzz.org>
5511Delivered-To: bbb@zzz.org
5512Received: by mail.zzz.org (Postfix, from userid 889)
5513\tid 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT)
5514MIME-Version: 1.0
5515Content-Transfer-Encoding: 7bit
5516Message-ID: <15090.61304.110929.45684@aaa.zzz.org>
5517From: bbb@ddd.com (John X. Doe)
5518To: bbb@zzz.org
5519Subject: This is a test message
5520Date: Fri, 4 May 2001 14:05:44 -0400
5521Content-Type: text/plain; charset="us-ascii";
5522 title*=us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21
5523
5524
5525Hi,
5526
5527Do you like this message?
5528
5529-Me
5530""")
5531
5532 # test_headerregistry.TestContentTypeHeader.rfc2231_encoded_charset
5533 # I changed the charset name, though, because the one in the file isn't

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected