Skip to content

test(be): Fill empty storage, nodes, and audit API tests - #2

Merged
dkovtun-voltagepark merged 2 commits into
mainfrom
fill-api-test-stubs
Sep 1, 2026
Merged

test(be): Fill empty storage, nodes, and audit API tests#2
dkovtun-voltagepark merged 2 commits into
mainfrom
fill-api-test-stubs

Conversation

@daniela-veloz-lai

@daniela-veloz-lai daniela-veloz-lai commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Empty generated API tests never called the client, so coverage fell below the 55% gate. These stubs now exercise success and error paths for storage, nodes, and audit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@daniela-veloz-lai daniela-veloz-lai changed the title Fill empty storage, nodes, and audit API tests test(be): Fill empty storage, nodes, and audit API tests Sep 1, 2026
@daniela-veloz-lai
daniela-veloz-lai requested a lite review from Copilot September 1, 2026 01:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The nodes API error-path test uses an undocumented status code for get_node_by_fleet_id, reducing contract-accurate coverage and potentially masking deserialization behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR replaces previously empty/generated backend API test stubs with real unit tests that exercise the SDK client’s request/response handling for storage, nodes, and audit endpoints, helping restore coverage above the gate.

Changes:

  • Added a json_response() helper for building mock JSON HTTP responses in tests.
  • Implemented success/error-path tests for StorageApi, NodesApi, and AuditApi by patching rest_client.request and asserting deserialized models / raised ApiException.
  • Introduced shared test constants and representative payloads for these APIs.
File summaries
File Description
test/utils.py Adds json_response() helper to produce JSON mock responses consistently.
test/test_storage_api.py Replaces stubs with assertions for add/get/list/update/delete storage view success + error cases.
test/test_nodes_api.py Replaces stubs with assertions for node fetch, power state, and list operations (success + error paths).
test/test_audit_api.py Replaces stubs with assertions for audit export status, starting export, and listing audit logs (success + error paths).
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/test_nodes_api.py Outdated
Co-authored-by: Cursor <cursoragent@cursor.com>
@dkovtun-voltagepark
dkovtun-voltagepark merged commit c0123b7 into main Sep 1, 2026
26 checks passed
@daniela-veloz-lai
daniela-veloz-lai deleted the fill-api-test-stubs branch September 1, 2026 16:54
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