hass.tibber_prices/tests
Julian Pawlowski d1376c8921 test(cleanup): add comprehensive resource cleanup tests
Added 40+ tests verifying memory leak prevention patterns:

- Listener cleanup: Time-sensitive, minute-update, lifecycle callbacks
- Timer cancellation: Quarter-hour, minute timers
- Config entry cleanup: Options update listener via async_on_unload
- Cache invalidation: Config, period, trend caches
- Storage cleanup: Cache files deleted on entry removal

Tests verify cleanup patterns exist in code (not full integration tests
due to complex mocking requirements).

Impact: Documents and tests cleanup contracts for future maintainability.
Prevents memory leaks when entities removed or config changed.
2025-11-22 04:46:11 +00:00
..
__init__.py test: add pytest framework and midnight-crossing tests 2025-11-21 23:47:01 +00:00
test_avg_none_fallback.py fix(calculations): handle negative electricity prices correctly 2025-11-22 04:45:23 +00:00
test_cache_age.py fix(coordinator): use coordinator update timestamp for cache validity 2025-11-22 04:44:22 +00:00
test_cache_validity.py fix(coordinator): use coordinator update timestamp for cache validity 2025-11-22 04:44:22 +00:00
test_cache_validity_after_midnight.py fix(coordinator): use coordinator update timestamp for cache validity 2025-11-22 04:44:22 +00:00
test_chart_data_push_updates.py feat(sensors): add lifecycle callback for chart_data_export sensor 2025-11-22 04:44:38 +00:00
test_config_validators.py refactor(config): use negative values for Best Price min_distance 2025-11-22 04:44:57 +00:00
test_coordinator_shutdown.py test(cleanup): add comprehensive resource cleanup tests 2025-11-22 04:46:11 +00:00
test_lifecycle_state.py fix(sensors): ensure connection/tomorrow_data/lifecycle consistency 2025-11-22 04:45:57 +00:00
test_midnight_handler.py feat(coordinator): add atomic midnight turnover coordination 2025-11-22 04:45:41 +00:00
test_midnight_periods.py test: add pytest framework and midnight-crossing tests 2025-11-21 23:47:01 +00:00
test_midnight_turnover.py refactor(config): use negative values for Best Price min_distance 2025-11-22 04:44:57 +00:00
test_minmax_none_fallback.py fix(calculations): handle negative electricity prices correctly 2025-11-22 04:45:23 +00:00
test_percentage_calculations.py fix(calculations): handle negative electricity prices correctly 2025-11-22 04:45:23 +00:00
test_price_calculations.py fix(calculations): handle negative electricity prices correctly 2025-11-22 04:45:23 +00:00
test_rating_threshold_validation.py fix(calculations): handle negative electricity prices correctly 2025-11-22 04:45:23 +00:00
test_resource_cleanup.py test(cleanup): add comprehensive resource cleanup tests 2025-11-22 04:46:11 +00:00
test_sensor_consistency.py fix(sensors): ensure connection/tomorrow_data/lifecycle consistency 2025-11-22 04:45:57 +00:00