In alertsystem.py, the /weather endpoint contains several error-handling branches but currently lacks the required test coverage.
This includes:
- Missing city/state/country input
- Missing OPENWEATHER_API_KEY
- Invalid location not found
- Unexpected internal exceptions
Without automated tests, future changes may accidentally break these error-handling paths without being detected.
To resolve this issue, we can cover these pytest test cases:
- Missing required fields that return HTTP 400
- Missing API key that return HTTP 500
- Invalid location that return HTTP 404
- Internal server exceptions that return HTTP 500
This will further improve the backend automation on this project.
I'd like to work on this issue if approved.
In alertsystem.py, the /weather endpoint contains several error-handling branches but currently lacks the required test coverage.
This includes:
Without automated tests, future changes may accidentally break these error-handling paths without being detected.
To resolve this issue, we can cover these pytest test cases:
This will further improve the backend automation on this project.
I'd like to work on this issue if approved.