test: add unit tests for current_conditions.py (8% → 95% coverage)#260
Merged
test: add unit tests for current_conditions.py (8% → 95% coverage)#260
Conversation
Add 86 tests covering all public functions in the current conditions presentation module including temperature formatting, seasonal metrics, astronomical metrics, environmental metrics, trend computation, and the main build_current_conditions integration. Closes #259
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add 86 unit tests for
src/accessiweather/display/presentation/current_conditions.py, bringing coverage from 8% to 95%.What's tested
format_temperature_value- all unit preferences and edge cases_build_basic_metrics- full data, minimal data, hidden fields_build_astronomical_metrics- with/without times, moon phase_build_environmental_metrics- air quality, pollen, edge cases_build_seasonal_metrics- snow, wind chill, heat index, frost, freezing level, precipitation, severe risk_build_trend_metrics- with/without trends, sparklines, pressure filteringcompute_pressure_trend_from_hourly- inHg, mb, missing datadescribe_trend,direction_descriptor,split_direction_descriptor_categorize_metric,_order_metrics_by_priorityformat_trend_lines,_get_severe_risk_descriptionbuild_current_conditionsintegration testsValidation
uv run ruff check .passesuv run pytestpasses (911 tests, 1 skipped)Closes #259