test: add unit and integration tests for backend APIs and risk calculation#201
Open
Suhaskumard wants to merge 1 commit into
Open
test: add unit and integration tests for backend APIs and risk calculation#201Suhaskumard wants to merge 1 commit into
Suhaskumard wants to merge 1 commit into
Conversation
Author
|
Hi @thetechguardians, |
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.
Add Comprehensive Backend Testing Suite and Risk Logic Refactoring
This PR introduces a comprehensive backend testing suite for Climate-Shield and refactors the weather risk calculation logic into a dedicated module to improve maintainability, testability, and code organization.
Closes #182
Type of Change
☑️ Feature
☑️ Backend
☑️ Testing
☑️ Refactoring
☑️ Documentation
Changes Made
Refactored weather risk calculation logic from
alertsystem.pyinto a dedicatedrisk_calculator.pymoduleImproved separation of concerns by isolating business logic from API routes
Added centralized risk calculation utilities for:
Added Pytest-based testing infrastructure
Added reusable test fixtures through
conftest.pyAdded unit tests for risk calculation algorithms
Added integration tests for weather API endpoints
Added integration tests for chatbot API endpoints
Added validation for:
Added API error handling tests for:
Added chatbot validation tests for:
Added implementation walkthrough documentation
Files Added
backend/risk_calculator.pybackend/conftest.pybackend/test_risk_calculator.pybackend/test_weather_api.pybackend/test_chatbot_api.pywalkthrough.mdFiles Modified
backend/alertsystem.pytask.mdHow Has This Been Tested?
Test Results
============================= 22 passed in 0.11s =============================Checklist
☑️ My code follows the existing code style of the project
☑️ I have performed a self-review of my own code
☑️ I have added/updated tests where necessary
☑️ All backend tests pass successfully
☑️ My changes do not introduce any new warnings or errors
☑️ I have linked the related issue