MCPcopy Create free account
hub / github.com/bleachbit/bleachbit / test_options_import_failure

Method test_options_import_failure

tests/TestLanguage.py:132–140  ·  view source on GitHub ↗

Test handling of failed Options import in language detection

(self)

Source from the content-addressed store, hash-verified

130 ('Vista previa', 'Previsualizar'))
131
132 def test_options_import_failure(self):
133 """Test handling of failed Options import in language detection"""
134 with mock.patch.dict('sys.modules', {'bleachbit.Options': None}):
135 with self.assertLogs(level='ERROR') as log_context:
136 result = get_active_language_code()
137 self.assertIn("Failed to get language options",
138 log_context.output[0])
139
140 self.assertIn(result, [locale.getlocale()[0], 'C', 'en', 'en_US'])

Callers

nothing calls this directly

Calls 1

get_active_language_codeFunction · 0.90

Tested by

no test coverage detected