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

Method test_set_param

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

Source from the content-addressed store, hash-verified

5382 ('us-ascii', 'en', '"This is even more ***fun*** isn\'t it!"'))
5383
5384 def test_set_param(self):
5385 eq = self.ndiffAssertEqual
5386 msg = Message()
5387 msg.set_param('title', 'This is even more ***fun*** isn\'t it!',
5388 charset='us-ascii')
5389 eq(msg.get_param('title'),
5390 ('us-ascii', '', 'This is even more ***fun*** isn\'t it!'))
5391 msg.set_param('title', 'This is even more ***fun*** isn\'t it!',
5392 charset='us-ascii', language='en')
5393 eq(msg.get_param('title'),
5394 ('us-ascii', 'en', 'This is even more ***fun*** isn\'t it!'))
5395 msg = self._msgobj('msg_01.txt')
5396 msg.set_param('title', 'This is even more ***fun*** isn\'t it!',
5397 charset='us-ascii', language='en')
5398 eq(msg.as_string(maxheaderlen=78), """\
5399Return-Path: <bbb@zzz.org>
5400Delivered-To: bbb@zzz.org
5401Received: by mail.zzz.org (Postfix, from userid 889)
5402\tid 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT)
5403MIME-Version: 1.0
5404Content-Transfer-Encoding: 7bit
5405Message-ID: <15090.61304.110929.45684@aaa.zzz.org>
5406From: bbb@ddd.com (John X. Doe)
5407To: bbb@zzz.org
5408Subject: This is a test message
5409Date: Fri, 4 May 2001 14:05:44 -0400
5410Content-Type: text/plain; charset=us-ascii;
5411 title*=us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21
5412
5413
5414Hi,
5415
5416Do you like this message?
5417
5418-Me
5419""")
5420
5421 def test_set_param_requote(self):
5422 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.85
_msgobjMethod · 0.45

Tested by

no test coverage detected