MCPcopy Index your code
hub / github.com/google/go-github / TestRateLimitError

Function TestRateLimitError

github/github_test.go:4200–4217  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

4198}
4199
4200func TestRateLimitError(t *testing.T) {
4201 t.Parallel()
4202 u, err := url.Parse("https://example.com")
4203 if err != nil {
4204 t.Fatal(err)
4205 }
4206
4207 r := &RateLimitError{
4208 Response: &http.Response{
4209 Request: &http.Request{Method: "PUT", URL: u},
4210 StatusCode: http.StatusTooManyRequests,
4211 },
4212 Message: "<msg>",
4213 }
4214 if got, want := r.Error(), "PUT https://example.com: 429 <msg> [rate limit was reset"; !strings.Contains(got, want) {
4215 t.Errorf("RateLimitError = %q, want %q", got, want)
4216 }
4217}
4218
4219func TestAcceptedError(t *testing.T) {
4220 t.Parallel()

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…