MCPcopy Create free account
hub / github.com/google/go-github / failIfNotStatusCode

Function failIfNotStatusCode

test/integration/authorizations_test.go:113–117  ·  view source on GitHub ↗

failIfNotStatusCode invokes t.Fatal() if the response's status code doesn't match the expected code.

(t *testing.T, resp *github.Response, expectedCode int)

Source from the content-addressed store, hash-verified

111
112// failIfNotStatusCode invokes t.Fatal() if the response's status code doesn't match the expected code.
113func failIfNotStatusCode(t *testing.T, resp *github.Response, expectedCode int) {
114 if resp.StatusCode != expectedCode {
115 t.Fatalf("Expected HTTP status code [%v] but received [%v]", expectedCode, resp.StatusCode)
116 }
117}
118
119// getOAuthAppClient returns a GitHub client for authorization testing. The client
120// uses BasicAuth, but instead of username and password, it uses the client id

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…