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

Method test_encode_default_args

Lib/test/test_userstring.py:136–141  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

134 self.assertEqual(fmt2 % str3, 'value is TEST')
135
136 def test_encode_default_args(self):
137 self.checkequal(b'hello', 'hello', 'encode')
138 # Check that encoding defaults to utf-8
139 self.checkequal(b'\xf0\xa3\x91\x96', '\U00023456', 'encode')
140 # Check that errors defaults to 'strict'
141 self.checkraises(UnicodeError, '\ud800', 'encode')
142
143 def test_encode_explicit_none_args(self):
144 self.checkequal(b'hello', 'hello', 'encode', None, None)

Callers

nothing calls this directly

Calls 2

checkequalMethod · 0.95
checkraisesMethod · 0.95

Tested by

no test coverage detected