(t *testing.T)
| 167 | } |
| 168 | |
| 169 | func TestRESTAndRESTWithNextErrorTypeParity(t *testing.T) { |
| 170 | reg := &httpmock.Registry{} |
| 171 | defer reg.Verify(t) |
| 172 | client := newTestClient(reg) |
| 173 | |
| 174 | responder := func(req *http.Request) (*http.Response, error) { |
| 175 | return &http.Response{ |
| 176 | Request: req, |
| 177 | StatusCode: http.StatusNotFound, |
| 178 | Body: io.NopCloser(bytes.NewBufferString(`{"message": "Not Found"}`)), |
| 179 | Header: http.Header{"Content-Type": {"application/json"}}, |
| 180 | }, nil |
| 181 | } |
| 182 | reg.Register(httpmock.MatchAny, responder) |
| 183 | reg.Register(httpmock.MatchAny, responder) |
| 184 | |
| 185 | restErr := client.REST("github.com", http.MethodGet, "repos/owner/repo/items", nil, nil) |
| 186 | _, restWithNextErr := client.RESTWithNext("github.com", http.MethodGet, "repos/owner/repo/items", nil, nil) |
| 187 | |
| 188 | require.Error(t, restErr) |
| 189 | require.Error(t, restWithNextErr) |
| 190 | assert.IsType(t, restErr, restWithNextErr) |
| 191 | } |
| 192 | |
| 193 | func TestRESTWithNext(t *testing.T) { |
| 194 | reg := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected