MCPcopy
hub / github.com/cortesi/devd / AssertCode

Function AssertCode

common_test.go:34–38  ·  view source on GitHub ↗

AssertCode asserts that the HTTP return code matches an expected value

(t *testing.T, resp *httptest.ResponseRecorder, code int)

Source from the content-addressed store, hash-verified

32
33// AssertCode asserts that the HTTP return code matches an expected value
34func AssertCode(t *testing.T, resp *httptest.ResponseRecorder, code int) {
35 if resp.Code != code {
36 t.Errorf("Expected code %d, got %d", code, resp.Code)
37 }
38}

Callers 2

TestDevdRouteHandlerFunction · 0.85
TestDevdHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected