Test handling of failed Options import in language detection
(self)
| 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']) |
nothing calls this directly
no test coverage detected