Skip to content

Strengthen test assertions by explicitness#127

Merged
StephanMeijer merged 1 commit into
mainfrom
feat/improve-testing-assertions
May 11, 2026
Merged

Strengthen test assertions by explicitness#127
StephanMeijer merged 1 commit into
mainfrom
feat/improve-testing-assertions

Conversation

@StephanMeijer
Copy link
Copy Markdown
Collaborator

@StephanMeijer StephanMeijer commented May 7, 2026

  • Replace partial/lazy test assertions with explicit assert response.json() == {...} checks
  • Split multi-scenario tests into focused single-scenario tests

@StephanMeijer StephanMeijer requested review from Copilot and jmaupetit May 7, 2026 17:43
@StephanMeijer StephanMeijer changed the title ✅(tests) strengthen test assertions by explicitness Strengthen test assertions by explicitness May 7, 2026
@StephanMeijer StephanMeijer force-pushed the feat/improve-testing-assertions branch 2 times, most recently from 244def4 to 7262931 Compare May 7, 2026 17:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Tightens backend test expectations around document bulk indexing/deletion APIs and admin selftest redirects by replacing partial assertions with explicit full-response comparisons and splitting multi-scenario tests into focused cases.

Changes:

  • Strengthen API tests by asserting exact response.json() payloads for bulk indexing and deletion endpoints.
  • Split “invalid params” coverage in document deletion tests into separate single-scenario tests.
  • Make admin selftest redirect assertions more explicit by checking the full redirect URL.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/backend/core/tests/test_api_documents_index_bulk.py Replaces partial status-only assertions with explicit full response payload equality checks.
src/backend/core/tests/test_api_documents_delete.py Makes delete API assertions fully explicit and splits invalid-parameter scenarios into multiple tests.
src/backend/core/tests/test_admin_selftest.py Updates redirect assertions to check the full expected login redirect URL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/backend/core/tests/test_api_documents_index_bulk.py
Comment thread src/backend/core/tests/test_api_documents_delete.py
Comment thread src/backend/core/tests/test_admin_selftest.py
Comment thread src/backend/core/tests/test_admin_selftest.py
@StephanMeijer StephanMeijer force-pushed the feat/improve-testing-assertions branch 2 times, most recently from fa04269 to 0101931 Compare May 11, 2026 13:57
Comment thread src/backend/core/tests/test_api_documents_index_bulk.py
Signed-off-by: Stephan Meijer <me@stephanmeijer.com>
@StephanMeijer StephanMeijer force-pushed the feat/improve-testing-assertions branch from 0101931 to 486da91 Compare May 11, 2026 14:19
@StephanMeijer StephanMeijer merged commit 486da91 into main May 11, 2026
11 checks passed
@StephanMeijer StephanMeijer deleted the feat/improve-testing-assertions branch May 11, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants