Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed May 18, 2021
1 parent 00ec864 commit af5b180
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 1 addition & 6 deletions pkg/rpaas/client/autoscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,7 @@ func (c *client) UpdateAutoscale(ctx context.Context, args UpdateAutoscaleArgs)
return err
}

expectedStatus := http.StatusCreated
if shouldCreate {
expectedStatus = http.StatusOK
}

if resp.StatusCode != expectedStatus {
if resp.StatusCode > http.StatusCreated {
return newErrUnexpectedStatusCodeFromResponse(resp)
}

Expand Down
1 change: 1 addition & 0 deletions pkg/rpaas/client/internal_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func TestNewClientThroughTsuruWithOptions(t *testing.T) {
assert.EqualError(t, err, tt.expectedError)
} else {
require.NoError(t, err)
rpaasClient.(*client).client.Transport = nil // void compare
assert.Equal(t, tt.expected, rpaasClient.(*client))
}
if tt.teardown != nil {
Expand Down

0 comments on commit af5b180

Please sign in to comment.