Skip to content

test: improve weather_client_alerts.py (AlertAggregator) coverage from 11% to 90%+ #262

@Orinks

Description

@Orinks

Problem

weather_client_alerts.py has only 11% test coverage. The AlertAggregator class handles critical alert deduplication logic that is essentially untested.

Uncovered functionality

  • aggregate_alerts(): combining NWS + VC alerts, source tagging, empty handling
  • _deduplicate_alerts(): grouping logic
  • _is_duplicate(): event matching, area overlap, timezone-aware/naive onset comparison
  • _areas_overlap(): normalization and set intersection
  • _merge_duplicate_alerts(): source priority, description merging, metadata preference

Solution

Add unit tests covering all methods and edge cases.

Acceptance Criteria

  • Coverage reaches 90%+
  • All existing tests continue to pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions