Summary
Add unit tests for the /scan-url URL validation and reachability check logic added in #10.
Motivation
The validation logic in scan_url currently has no test coverage. Without tests, regressions in URL format checking, reachability detection, or timeout handling could go unnoticed.
Proposed solution
Add tests in the backend test suite that mock httpx to cover the following cases without making real network requests:
- Invalid URL format returns 422
- Non-existent repo (404 from GitHub HEAD request) returns 422
- Network timeout returns 422 with "Could not reach GitHub" message
- Valid public repo passes reachability check and proceeds normally
ML tier (if applicable)
Acceptance criteria
Additional context
Follow-up to PR #10.
@ionfwsrijan Please assign this issue to me. thanks!
Summary
Add unit tests for the
/scan-urlURL validation and reachability check logic added in #10.Motivation
The validation logic in
scan_urlcurrently has no test coverage. Without tests, regressions in URL format checking, reachability detection, or timeout handling could go unnoticed.Proposed solution
Add tests in the backend test suite that mock
httpxto cover the following cases without making real network requests:ML tier (if applicable)
Acceptance criteria
httpxis mocked — no real network calls made during testsAdditional context
Follow-up to PR #10.
@ionfwsrijan Please assign this issue to me. thanks!