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

Method test_filesystemencoding

Lib/test/test_utf8_mode.py:105–126  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

103
104 @unittest.expectedFailureIf(MS_WINDOWS, "TODO: RUSTPYTHON")
105 def test_filesystemencoding(self):
106 code = textwrap.dedent('''
107 import sys
108 print("{}/{}".format(sys.getfilesystemencoding(),
109 sys.getfilesystemencodeerrors()))
110 ''')
111
112 if MS_WINDOWS:
113 expected = 'utf-8/surrogatepass'
114 else:
115 expected = 'utf-8/surrogateescape'
116
117 out = self.get_output('-X', 'utf8', '-c', code)
118 self.assertEqual(out, expected)
119
120 if MS_WINDOWS:
121 # PYTHONLEGACYWINDOWSFSENCODING disables the UTF-8 mode
122 # and has the priority over -X utf8 and PYTHONUTF8
123 out = self.get_output('-X', 'utf8', '-c', code,
124 PYTHONUTF8='strict',
125 PYTHONLEGACYWINDOWSFSENCODING='1')
126 self.assertEqual(out, 'mbcs/replace')
127
128 # TODO: RUSTPYTHON
129 @unittest.expectedFailure

Callers

nothing calls this directly

Calls 3

get_outputMethod · 0.95
dedentMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected