MCPcopy Index your code
hub / github.com/bleachbit/bleachbit / test_encoding

Method test_encoding

tests/TestCLI.py:180–196  ·  view source on GitHub ↗

Unit test for encoding

(self)

Source from the content-addressed store, hash-verified

178
179 @common.skipIfWindows
180 def test_encoding(self):
181 """Unit test for encoding"""
182
183 filename = self.write_file(
184 '/tmp/bleachbit-test-cli-encoding-\xe4\xf6\xfc~')
185 # not assertExists because it doesn't cope with invalid encodings
186 self.assertTrue(os.path.exists(filename))
187
188 env = copy.deepcopy(os.environ)
189 env['LANG'] = 'en_US' # not UTF-8
190 args = [get_executable(), '-m', 'bleachbit.CLI', '-p', 'system.tmp']
191 # If Python pipes stdout to file or devnull, the test may give
192 # a false negative. It must print stdout to terminal.
193 self._test_preview(args, redirect_stdout=False, env=env)
194
195 os.remove(filename)
196 self.assertNotExists(filename)
197
198 def test_invalid_locale(self):
199 """Unit test for invalid locales"""

Callers

nothing calls this directly

Calls 4

_test_previewMethod · 0.95
get_executableFunction · 0.90
write_fileMethod · 0.80
assertNotExistsMethod · 0.80

Tested by

no test coverage detected