Skip to content

test : added unit tests for main.py exception handlers and redirect endpoints - #1730

Closed
tmdeveloper007 wants to merge 2 commits into
utksh1:mainfrom
tmdeveloper007:#1725
Closed

test : added unit tests for main.py exception handlers and redirect endpoints#1730
tmdeveloper007 wants to merge 2 commits into
utksh1:mainfrom
tmdeveloper007:#1725

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #1725.

Summary of What Has Been Done:
Extracted exception handlers and redirect endpoints from main.py into a standalone import-safe module (backend/secuscan/main_exception_handlers.py) so they can be unit tested without the heavy app initialization chain. The main.py now delegates to the extracted handlers. Added comprehensive unit tests for all handlers and redirects.

Changes Made:

  • New file: backend/secuscan/main_exception_handlers.py - standalone exception handlers and redirects
  • New file: testing/backend/unit/test_main.py - 22 unit tests covering all handlers
  • Modified: backend/secuscan/main.py - delegates to extracted handlers (no behavior change)

Impact it Made:

  • Coverage: adds tests for a module that was completely untested
  • Reliability: ensures consistent error responses across all error types
  • Extensibility: extracted handlers are now independently testable

Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.

@utksh1

utksh1 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Closing: this PR is part of the same mass template-generated low-value test batch pattern. The PRs use repetitive boilerplate bodies, copy-pasted structures, and in several cases manufacture tiny helpers or duplicate existing coverage rather than contributing one focused, meaningful improvement. Please submit a smaller, genuinely curated PR if you want to work on one concrete test gap.

@utksh1 utksh1 closed this Jul 7, 2026
@utksh1 utksh1 added gssoc:invalid Admin validation: invalid for GSSoC scoring gssoc:ai-slop Admin validation: low-quality AI-generated submission labels Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:ai-slop Admin validation: low-quality AI-generated submission gssoc:invalid Admin validation: invalid for GSSoC scoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test : add unit tests for main.py exception handlers

2 participants