Unit-test GiteaClient's 404->NotFound status mapping #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
GiteaClient::branch_sha/fetch_raw(src/gitea/client.rs:43-68) map a 404response to
GiteaError::NotFoundand any other non-success status toGiteaError::Transport. The 404->NotFoundbranch is the invariant-3broken-reference signal — load-bearing.
Gap
That status mapping is exercised by no unit test. The in-module tests cover
only
extract_commit_id(the pure parser);MockFetcherhardcodes its miss;the gated live smoke (
tests/live_smoke.rs) covers only the happy-path fetch.The 404 branch of the live client stays unverified.
Acceptance
A test that drives
GiteaClientagainst a controllable HTTP status — a localstub server, or an injectable status seam — and asserts 404 ->
NotFound,non-success ->
Transport, 200 -> body.Surfaced by the cycle-0001 close audit (architect drift, med).