Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marefr committed Oct 11, 2024
1 parent 02ca2a1 commit d783f35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions backend/httpclient/error_source_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ func TestErrorSourceMiddleware(t *testing.T) {
require.NoError(t, err)
resp, err := rt.RoundTrip(req)
require.Error(t, err)
require.Nil(t, resp)
if resp.Body != nil {
require.NoError(t, resp.Body.Close())
}
require.False(t, status.IsDownstreamError(err))
require.ErrorIs(t, err, someErr)
})
Expand All @@ -46,7 +48,9 @@ func TestErrorSourceMiddleware(t *testing.T) {
require.NoError(t, err)
resp, err := rt.RoundTrip(req)
require.Error(t, err)
require.Nil(t, resp)
if resp.Body != nil {
require.NoError(t, resp.Body.Close())
}
require.True(t, status.IsDownstreamError(err))
require.ErrorIs(t, err, someErr)
})
Expand Down
2 changes: 1 addition & 1 deletion backend/httpclient/http_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (c *testContext) createRoundTripper(name string) http.RoundTripper {

func (c *testContext) createRoundTripperWithError(err error) http.RoundTripper {
return RoundTripperFunc(func(_ *http.Request) (*http.Response, error) {
return nil, err
return &http.Response{}, err
})
}

Expand Down

0 comments on commit d783f35

Please sign in to comment.