Skip to content

BDMS 55: ensure location router is fully covered | remove expand functionality#79

Merged
jirhiker merged 10 commits into
pre-productionfrom
jab-api-coverage-location
Aug 12, 2025
Merged

BDMS 55: ensure location router is fully covered | remove expand functionality#79
jirhiker merged 10 commits into
pre-productionfrom
jab-api-coverage-location

Conversation

@jacob-a-brown

Copy link
Copy Markdown
Contributor

Why

This PR addresses the following problem / context:

  • All routers should have full GET, POST, PATCH, and DELETE coverage and tests

How

Implementation summary - the following was changed / added / removed:

  • the location router was missing the following endpoints, which have now been implemented and tested
    • DELETE /location/{location_id}
  • GET /location/{location_id} has been simplified.
  • POST and PATCH tests have been simplified and cleaned up
  • 404 tests for GET /location/{location_id} and PATCH /location/{location_id} were added

Notes

Any special considerations, workarounds, or follow-up work to note?

  • The expand query parameter is not used for /location GET requests, so it was removed to simplify the code base
  • Some tests in tests/test_thing.py were causing tests in tests/test_location.py to fail, so they were amended to improve test independence.
  • The function model_deleter was added to services/crud_helper.py to be reusable for all models.

@codecov-commenter

codecov-commenter commented Aug 12, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
api/location.py 92.85% <100.00%> (+18.78%) ⬆️
schemas/location.py 80.85% <ø> (ø)
services/crud_helper.py 100.00% <100.00%> (ø)
tests/test_geospatial.py 82.60% <100.00%> (+1.07%) ⬆️
tests/test_location.py 100.00% <100.00%> (+45.00%) ⬆️
tests/test_thing.py 100.00% <100.00%> (ø)

Comment thread api/location.py Outdated
Return 204 Response from model_deleter
@jirhiker jirhiker merged commit 8fc874a into pre-production Aug 12, 2025
3 checks passed
@jirhiker jirhiker deleted the jab-api-coverage-location branch December 3, 2025 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants