(retryAfter string)
| 136 | } |
| 137 | |
| 138 | func errorResponse429(retryAfter string) *http.Response { |
| 139 | body := "" |
| 140 | response := &http.Response{ |
| 141 | Status: "429 Too Many Requests", |
| 142 | StatusCode: 429, |
| 143 | Header: make(http.Header), |
| 144 | Body: ioutil.NopCloser(strings.NewReader(body)), |
| 145 | ContentLength: int64(len(body)), |
| 146 | } |
| 147 | response.Header.Set("Content-Type", "text/plain") |
| 148 | response.Header.Set("Retry-After", retryAfter) |
| 149 | return response |
| 150 | } |
| 151 | |
| 152 | func TestDecodeErrorResponse(t *testing.T) { |
| 153 | testCases := []struct { |
no outgoing calls
no test coverage detected