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

Method test_getencoding_fallback

Lib/test/test_locale.py:669–676  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

667 codecs.lookup(enc)
668
669 def test_getencoding_fallback(self):
670 # When _locale.getencoding() is missing, locale.getencoding() uses
671 # the Python filesystem
672 encoding = 'FALLBACK_ENCODING'
673 with mock.patch.object(sys, 'getfilesystemencoding',
674 return_value=encoding):
675 locale_fallback = import_fresh_module('locale', blocked=['_locale'])
676 self.assertEqual(locale_fallback.getencoding(), encoding)
677
678 def test_getpreferredencoding(self):
679 # Invoke getpreferredencoding to make sure it does not cause exceptions.

Callers

nothing calls this directly

Calls 2

import_fresh_moduleFunction · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected