Conversation
knowack1
requested changes
Jan 31, 2026
| @router.get( | ||
| "/sessions", | ||
| response_model=FaultedSessionsResponse, | ||
| dependencies=[Depends(require_scopes({"sessions:read"}))], |
Member
There was a problem hiding this comment.
This PR is suppose to be about tests but introduces something related to authorization - please cleanup.
| → must return 200 | ||
| """ | ||
| headers = { | ||
| "Authorization": "Bearer dev-secret-key" |
Member
There was a problem hiding this comment.
This is not authorization: anyone get provide such header. The string in the bearer should be digital signed. Read and apply JSON Web Token (JWT)
| charge_point_id="CP-TEST-001", | ||
| connector_id=1, | ||
| error_code="GroundFailure", | ||
| timestamp=datetime.now(UTC), # ← TU JEST KLUCZ |
|
|
||
|
|
||
| def insert_faulted_session(db): | ||
| session = db.insert_session( |
Member
There was a problem hiding this comment.
We should connect to the server as a charger - OCPP.
knowack1
reviewed
Jan 31, 2026
|
|
||
|
|
||
|
|
||
| def test_faulted_session_is_returned(client, db): |
Member
There was a problem hiding this comment.
we should focus only on this test. Other tests should be removed for now.
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 introduces initial automated test coverage for the OCPP session listing
and failure-detection flow, aligned with the current MVP scope.
During implementation, the tests exposed a real architectural issue:
duplicated response schemas and an inconsistent response shape for
/api/v1/sessions.This has been unified as part of the work, improving API consistency and correctness.
The current test set is considered sufficient for MVP:
/api/v1/sessionsAdditional test scenarios are intentionally deferred and will be handled
in follow-up issues once the session lifecycle logic is extended, including:
Architectural rationale and scope decisions are documented in ADR-001.