mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-30 05:13:40 +00:00
Added documentation file explaining why period calculation functions are tested via integration tests rather than unit tests. Rationale: - Period building requires full coordinator context (TimeService, price_context) - Complex enriched price data with multiple calculated fields - Helper functions (split_intervals_by_day, calculate_reference_prices) are simple transformations that can't fail independently - Integration tests provide better coverage than mocked unit tests Testing strategy: - test_midnight_periods.py: Period calculation across day boundaries - test_midnight_turnover.py: Cache invalidation and recalculation - docs/development/period-calculation-theory.md: Algorithm documentation Impact: Clarifies testing approach for future contributors. Prevents wasted effort on low-value unit tests for complex integrated functions. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_avg_none_fallback.py | ||
| test_cache_age.py | ||
| test_cache_validity.py | ||
| test_cache_validity_after_midnight.py | ||
| test_chart_data_push_updates.py | ||
| test_config_validators.py | ||
| test_coordinator_shutdown.py | ||
| test_lifecycle_state.py | ||
| test_midnight_handler.py | ||
| test_midnight_periods.py | ||
| test_midnight_turnover.py | ||
| test_minmax_none_fallback.py | ||
| test_next_api_poll.py | ||
| test_percentage_calculations.py | ||
| test_period_calculation.py | ||
| test_price_calculations.py | ||
| test_rating_threshold_validation.py | ||
| test_resource_cleanup.py | ||
| test_sensor_consistency.py | ||
| test_sensor_timer_assignment.py | ||
| test_time_service.py | ||
| test_timer_scheduling.py | ||