Skip to content

test: improve history endpoint edge case coverage#977

Open
jyotish6699 wants to merge 1 commit into
imDarshanGK:mainfrom
jyotish6699:test/history-edge-cases
Open

test: improve history endpoint edge case coverage#977
jyotish6699 wants to merge 1 commit into
imDarshanGK:mainfrom
jyotish6699:test/history-edge-cases

Conversation

@jyotish6699

Copy link
Copy Markdown

Summary

This PR improves test coverage for the history module by adding validation, boundary, and database behavior tests.

Added Tests

  • Verify oversized code submissions are rejected (max_length=50000)
  • Verify pagination limit upper-bound validation
  • Verify pagination limit lower-bound validation
  • Verify search limit upper-bound validation
  • Verify code preview truncation behavior
  • Verify SHA256 code hash generation
  • Verify deleting the same history entry twice returns a 404 response

Testing

Executed successfully:

pytest backend/tests/test_history.py -v
pytest

Results:

  • 15/15 history tests passing
  • Full test suite passing (423 tests)

Impact

  • Improves confidence in API validation behavior
  • Covers important database-specific functionality
  • Helps prevent regressions in history-related features
  • Strengthens edge-case coverage

Closes #833

@jyotish6699 jyotish6699 requested a review from imDarshanGK as a code owner June 10, 2026 06:20
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.

1 participant