|
|
|
@ -430,6 +430,24 @@ func TestDo_rateLimit_errorResponse(t *testing.T) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func TestDo_noContent(t *testing.T) { |
|
|
|
setup() |
|
|
|
defer teardown() |
|
|
|
|
|
|
|
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |
|
|
|
w.WriteHeader(http.StatusNoContent) |
|
|
|
}) |
|
|
|
|
|
|
|
var body json.RawMessage |
|
|
|
|
|
|
|
req, _ := client.NewRequest("GET", "/", nil) |
|
|
|
_, err := client.Do(req, &body) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
t.Fatalf("Do returned unexpected error: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func TestSanitizeURL(t *testing.T) { |
|
|
|
tests := []struct { |
|
|
|
in, want string |
|
|
|
|