MCPcopy Index your code
hub / github.com/basecamp/once / TestVerifyHTTP_ServerError

Function TestVerifyHTTP_ServerError

internal/docker/application_test.go:48–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func TestVerifyHTTP_ServerError(t *testing.T) {
49 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
50 w.WriteHeader(http.StatusInternalServerError)
51 }))
52 defer server.Close()
53
54 app := &Application{
55 Settings: ApplicationSettings{Host: server.Listener.Addr().String(), DisableTLS: true},
56 }
57
58 err := app.verifyHTTP(context.Background())
59 require.Error(t, err)
60 assert.ErrorIs(t, err, ErrVerificationFailed)
61 assert.Contains(t, err.Error(), "unexpected status 500")
62}
63
64func TestVerifyHTTP_Unreachable(t *testing.T) {
65 app := &Application{

Callers

nothing calls this directly

Calls 4

verifyHTTPMethod · 0.95
WriteHeaderMethod · 0.80
CloseMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…