MCPcopy
hub / github.com/basecamp/once / TestVerifyHTTP_Success

Function TestVerifyHTTP_Success

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

Source from the content-addressed store, hash-verified

11)
12
13func TestVerifyHTTP_Success(t *testing.T) {
14 var requestPath string
15 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
16 requestPath = r.URL.Path
17 w.WriteHeader(http.StatusOK)
18 }))
19 defer server.Close()
20
21 app := &Application{
22 Settings: ApplicationSettings{Host: server.Listener.Addr().String(), DisableTLS: true},
23 }
24
25 err := app.verifyHTTP(context.Background())
26 assert.NoError(t, err)
27 assert.Equal(t, HealthCheckPath, requestPath)
28}
29
30func TestVerifyHTTP_RedirectToSuccess(t *testing.T) {
31 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 4

verifyHTTPMethod · 0.95
WriteHeaderMethod · 0.80
EqualMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…