MCPcopy
hub / github.com/perkeep/perkeep / TestInternalHandler

Function TestInternalHandler

pkg/test/integration/camlistore_test.go:124–145  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

122}
123
124func TestInternalHandler(t *testing.T) {
125 w := test.GetWorld(t)
126 tests := map[string]int{
127 "/": http.StatusOK,
128 "/test-that-root-handler-returns-404": http.StatusNotFound,
129 "/no-http-storage/": http.StatusUnauthorized,
130 "/no-http-handler/": http.StatusUnauthorized,
131 "/bs-and-maybe-also-index/camli": http.StatusBadRequest,
132 "/bs/camli/sha1-b2201302e129a4396a323cb56283cddeef11bbe8": http.StatusNotFound,
133 "/no-http-storage/camli/sha1-b2201302e129a4396a323cb56283cddeef11bbe8": http.StatusUnauthorized,
134 }
135 for suffix, want := range tests {
136 res, err := http.Get(w.ServerBaseURL() + suffix)
137 if err != nil {
138 t.Fatalf("On %s: %v", suffix, err)
139 }
140 if res.StatusCode != want {
141 t.Errorf("For %s: Status = %d; want %d", suffix, res.StatusCode, want)
142 }
143 res.Body.Close()
144 }
145}
146
147func TestNoTestingLinking(t *testing.T) {
148 w, err := test.NewWorld()

Callers

nothing calls this directly

Calls 5

GetWorldFunction · 0.92
ServerBaseURLMethod · 0.80
GetMethod · 0.65
FatalfMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected