Unit test for encoding
(self)
| 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""" |
nothing calls this directly
no test coverage detected