MCPcopy
hub / github.com/bitfield/script / TestGetSetsErrorStatusWhenHTTPResponseStatusIsNotOK

Function TestGetSetsErrorStatusWhenHTTPResponseStatusIsNotOK

script_test.go:663–673  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

661}
662
663func TestGetSetsErrorStatusWhenHTTPResponseStatusIsNotOK(t *testing.T) {
664 t.Parallel()
665 // With no handler, all requests will get 404
666 ts := httptest.NewServer(nil)
667 defer ts.Close()
668 p := script.Get(ts.URL)
669 p.Wait()
670 if p.Error() == nil {
671 t.Fatalf("want error for non-OK request, got nil")
672 }
673}
674
675func TestGetConsidersHTTPStatus201CreatedToBeOK(t *testing.T) {
676 t.Parallel()

Callers

nothing calls this directly

Calls 4

GetFunction · 0.92
WaitMethod · 0.80
ErrorMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…