Skip to content

BDMS 55: sensor coverage | reusable test functions | PydanticStyleException#81

Merged
jirhiker merged 24 commits into
pre-productionfrom
jab-api-coverage-sensor
Aug 15, 2025
Merged

BDMS 55: sensor coverage | reusable test functions | PydanticStyleException#81
jirhiker merged 24 commits into
pre-productionfrom
jab-api-coverage-sensor

Conversation

@jacob-a-brown

@jacob-a-brown jacob-a-brown commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

Why

This PR addresses the following problem / context:

  • The /sensor router should be fully covered with GET, GET by ID, PATCH, POST, and DELETE endpoints
  • Exceptions raised outside of Pydantic should maintain the same style to enable consistency and ease of use throughout the API

How

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

  • Added PATCH and DELETE endpoints
  • Ensured all endpoints are covered in tests
  • Write a PydanticStyleException class in services/exception_helper.py

Notes

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

  • Updated the sensor fixture to populate all sensor fields
  • Updated the model and schema to rename date_ fields datetime_ to reflect their data type
  • Made all datetime_ fields time zone aware and UTC
  • Fixed custom validation tests for other schemas

@codecov-commenter

codecov-commenter commented Aug 13, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.43820% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
schemas/sensor.py 96.66% 1 Missing ⚠️
Files with missing lines Coverage Δ
api/sensor.py 85.41% <100.00%> (+6.62%) ⬆️
db/__init__.py 95.23% <100.00%> (-0.12%) ⬇️
db/sensor.py 100.00% <100.00%> (ø)
schemas/sample.py 98.41% <100.00%> (+1.69%) ⬆️
services/exceptions_helper.py 100.00% <100.00%> (ø)
tests/__init__.py 100.00% <100.00%> (ø)
tests/conftest.py 100.00% <100.00%> (ø)
tests/test_sample.py 100.00% <100.00%> (+1.37%) ⬆️
tests/test_sensor.py 100.00% <100.00%> (ø)
schemas/sensor.py 97.61% <96.66%> (-2.39%) ⬇️

... and 2 files with indirect coverage changes

Comment thread tests/test_sample.py Outdated

@jirhiker jirhiker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jirhiker jirhiker merged commit 74131eb into pre-production Aug 15, 2025
3 checks passed
@jirhiker jirhiker deleted the jab-api-coverage-sensor branch December 3, 2025 04:56
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