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

Method test_charset

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

Source from the content-addressed store, hash-verified

1805 self.assertFalse(self._msg.is_multipart())
1806
1807 def test_charset(self):
1808 eq = self.assertEqual
1809 msg = MIMEText('hello there', _charset='us-ascii')
1810 eq(msg.get_charset().input_charset, 'us-ascii')
1811 eq(msg['content-type'], 'text/plain; charset="us-ascii"')
1812 # Also accept a Charset instance
1813 charset = Charset('utf-8')
1814 charset.body_encoding = None
1815 msg = MIMEText('hello there', _charset=charset)
1816 eq(msg.get_charset().input_charset, 'utf-8')
1817 eq(msg['content-type'], 'text/plain; charset="utf-8"')
1818 eq(msg.get_payload(), 'hello there')
1819
1820 def test_7bit_input(self):
1821 eq = self.assertEqual

Callers

nothing calls this directly

Calls 5

MIMETextClass · 0.90
CharsetClass · 0.90
get_charsetMethod · 0.80
get_payloadMethod · 0.80
eqFunction · 0.50

Tested by

no test coverage detected