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

Method test_set_param

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

Source from the content-addressed store, hash-verified

511 self.assertNotIn('headerx', msg)
512
513 def test_set_param(self):
514 eq = self.assertEqual
515 msg = Message()
516 msg.set_param('charset', 'iso-2022-jp')
517 eq(msg.get_param('charset'), 'iso-2022-jp')
518 msg.set_param('importance', 'high value')
519 eq(msg.get_param('importance'), 'high value')
520 eq(msg.get_param('importance', unquote=False), '"high value"')
521 eq(msg.get_params(), [('text/plain', ''),
522 ('charset', 'iso-2022-jp'),
523 ('importance', 'high value')])
524 eq(msg.get_params(unquote=False), [('text/plain', ''),
525 ('charset', '"iso-2022-jp"'),
526 ('importance', '"high value"')])
527 msg.set_param('charset', 'iso-9999-xx', header='X-Jimmy')
528 eq(msg.get_param('charset', header='X-Jimmy'), 'iso-9999-xx')
529
530 def test_del_param(self):
531 eq = self.assertEqual

Callers

nothing calls this directly

Calls 5

set_paramMethod · 0.95
get_paramMethod · 0.95
get_paramsMethod · 0.95
MessageClass · 0.90
eqFunction · 0.85

Tested by

no test coverage detected