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

Method test_codec_lookup_failure

Lib/test/test_codecs.py:3251–3260  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3249
3250 # http://bugs.python.org/issue19609
3251 def test_codec_lookup_failure(self):
3252 msg = "^unknown encoding: {}$".format(self.codec_name)
3253 with self.assertRaisesRegex(LookupError, msg):
3254 "str input".encode(self.codec_name)
3255 with self.assertRaisesRegex(LookupError, msg):
3256 codecs.encode("str input", self.codec_name)
3257 with self.assertRaisesRegex(LookupError, msg):
3258 b"bytes input".decode(self.codec_name)
3259 with self.assertRaisesRegex(LookupError, msg):
3260 codecs.decode(b"bytes input", self.codec_name)
3261
3262 def test_unflagged_non_text_codec_handling(self):
3263 # The stdlib non-text codecs are now marked so they're

Callers

nothing calls this directly

Calls 4

assertRaisesRegexMethod · 0.80
formatMethod · 0.45
encodeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected