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

Method test_set_param

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

Source from the content-addressed store, hash-verified

5453 ('us-ascii', 'en', '"This is even more ***fun*** isn\'t it!"'))
5454
5455 def test_set_param(self):
5456 eq = self.ndiffAssertEqual
5457 msg = Message()
5458 msg.set_param('title', 'This is even more ***fun*** isn\'t it!',
5459 charset='us-ascii')
5460 eq(msg.get_param('title'),
5461 ('us-ascii', '', 'This is even more ***fun*** isn\'t it!'))
5462 msg.set_param('title', 'This is even more ***fun*** isn\'t it!',
5463 charset='us-ascii', language='en')
5464 eq(msg.get_param('title'),
5465 ('us-ascii', 'en', 'This is even more ***fun*** isn\'t it!'))
5466 msg = self._msgobj('msg_01.txt')
5467 msg.set_param('title', 'This is even more ***fun*** isn\'t it!',
5468 charset='us-ascii', language='en')
5469 eq(msg.as_string(maxheaderlen=78), """\
5470Return-Path: <bbb@zzz.org>
5471Delivered-To: bbb@zzz.org
5472Received: by mail.zzz.org (Postfix, from userid 889)
5473\tid 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT)
5474MIME-Version: 1.0
5475Content-Transfer-Encoding: 7bit
5476Message-ID: <15090.61304.110929.45684@aaa.zzz.org>
5477From: bbb@ddd.com (John X. Doe)
5478To: bbb@zzz.org
5479Subject: This is a test message
5480Date: Fri, 4 May 2001 14:05:44 -0400
5481Content-Type: text/plain; charset=us-ascii;
5482 title*=us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21
5483
5484
5485Hi,
5486
5487Do you like this message?
5488
5489-Me
5490""")
5491
5492 def test_set_param_requote(self):
5493 msg = Message()

Callers

nothing calls this directly

Calls 6

set_paramMethod · 0.95
get_paramMethod · 0.95
as_stringMethod · 0.95
MessageClass · 0.90
eqFunction · 0.50
_msgobjMethod · 0.45

Tested by

no test coverage detected