Addresses #65 the test suite was incomplete, some fixtures were broken or misplaced, and there were no tests for the API routes.#89
Open
EmmanuelNiyonshuti wants to merge 10 commits intoagstack:mainfrom
Conversation
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.
This PR fixes the existing test setup and adds missing API route tests. Addresses #65
Small fixes on the existing test setup, shared fixtures were scattered across
tests/fixtures/instead ofconftest.pyso, I moved them there. Renamedtest_jwt_tokentojwt_tokensince thetest_prefix is for test functions. Added missing fixtures for response shapes that the new tests needed.Added two new unit tests for
get_thiinTestOpenWeatherMap, one for the default path and one forocsm=True.Added
tests/api/with three new test files:test_data_routes.pyall routes insrc/api/api.py, testing 200, 500, and 403 per routetest_locations.pyintegration tests hitting the in-memory mock DB directly. Two routes that depend on MongoDB$neargeospatial queries are skipped since mongomock doesn't support themtest_history.pyboth history routes. Only the cache miss path is testable for the same$nearreason. Skipped tests are left in with comments for whoever picks them up later.