MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / httpGet

Function httpGet

main_test.go:1350–1359  ·  view source on GitHub ↗
(t *testing.T, url string, statusCode int)

Source from the content-addressed store, hash-verified

1348}
1349
1350func httpGet(t *testing.T, url string, statusCode int) *http.Response {
1351 resp, err := http.Get(url)
1352 if err != nil {
1353 t.Fatalf("unexpected erorr while doing GET request: %s", err)
1354 }
1355 if resp.StatusCode != statusCode {
1356 t.Fatalf("unexpected status code: %d; expected: %d", resp.StatusCode, statusCode)
1357 }
1358 return resp
1359}
1360
1361func checkHeader(t *testing.T, resp *http.Response, header string, expected string) {
1362 t.Helper()

Callers 1

TestServeFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected