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

Method test_add_header

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

Source from the content-addressed store, hash-verified

1613 self.assertEqual(au.get_content_type(), 'audio/fish')
1614
1615 def test_add_header(self):
1616 self._make_audio('au')
1617 eq = self.assertEqual
1618 self._au.add_header('Content-Disposition', 'attachment',
1619 filename='sndhdr.au')
1620 eq(self._au['content-disposition'],
1621 'attachment; filename="sndhdr.au"')
1622 eq(self._au.get_params(header='content-disposition'),
1623 [('attachment', ''), ('filename', 'sndhdr.au')])
1624 eq(self._au.get_param('filename', header='content-disposition'),
1625 'sndhdr.au')
1626 missing = []
1627 eq(self._au.get_param('attachment', header='content-disposition'), '')
1628 self.assertIs(self._au.get_param(
1629 'foo', failobj=missing,
1630 header='content-disposition'), missing)
1631 # Try some missing stuff
1632 self.assertIs(self._au.get_param('foobar', missing), missing)
1633 self.assertIs(self._au.get_param('attachment', missing,
1634 header='foobar'), missing)
1635
1636
1637

Callers

nothing calls this directly

Calls 6

_make_audioMethod · 0.95
get_paramsMethod · 0.80
get_paramMethod · 0.80
eqFunction · 0.50
add_headerMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected