MCPcopy
hub / github.com/perkeep/perkeep / testLoginRequest

Function testLoginRequest

internal/httputil/auth_test.go:115–128  ·  view source on GitHub ↗
(t *testing.T, client *http.Client, URL string)

Source from the content-addressed store, hash-verified

113}
114
115func testLoginRequest(t *testing.T, client *http.Client, URL string) {
116 res, err := client.Get(URL)
117 if err != nil {
118 t.Fatal(err)
119 }
120 body, err := io.ReadAll(res.Body)
121 if err != nil {
122 t.Fatal(err)
123 }
124 const exp = "authorized"
125 if string(body) != exp {
126 t.Errorf("got %q (instead of %v)", string(body), exp)
127 }
128}
129
130func TestBasicAuth(t *testing.T) {
131 for _, d := range []struct {

Callers 2

TestLocalhostAuthIPv6Function · 0.85
TestLocalhostAuthIPv4Function · 0.85

Calls 3

FatalMethod · 0.80
ReadAllMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected