Test overrides work with different sections
(self)
| 346 | o.reset_overrides() |
| 347 | |
| 348 | def test_override_with_sections(self): |
| 349 | """Test overrides work with different sections""" |
| 350 | o = bleachbit.Options.options |
| 351 | |
| 352 | # Test override in non-default section |
| 353 | if not o.config.has_section('test_section'): |
| 354 | o.config.add_section('test_section') |
| 355 | o.config.set('test_section', 'test_key', 'original_value') |
| 356 | |
| 357 | o.set_override('test_key', 'override_value', section='test_section') |
| 358 | self.assertEqual( |
| 359 | o.get('test_key', section='test_section'), 'override_value') |
| 360 | |
| 361 | # Verify flush doesn't write override |
| 362 | o.commit() |
| 363 | o2 = bleachbit.Options.Options() |
| 364 | self.assertEqual( |
| 365 | o2.get('test_key', section='test_section'), 'original_value') |
| 366 | o2.close() |
| 367 | |
| 368 | # Clean up |
| 369 | o.reset_overrides() |
| 370 | if o.config.has_section('test_section'): |
| 371 | o.config.remove_section('test_section') |
| 372 | |
| 373 | def test_flush_mechanisms_timer_and_close(self): |
| 374 | """Test that changes flush correctly via timer fire or explicit close().""" |
nothing calls this directly
no test coverage detected