Skip to content

Commit

Permalink
Changes in mock and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Sama committed Sep 18, 2020
1 parent 701e89f commit 2e0a1d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions common/testclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ func (c *TestClient) Patch(url string, payload interface{}) (*http.Response, err
}

// Delete performs a Delete request against the Redfish service.
func (c *TestClient) Delete(url string) error {
func (c *TestClient) Delete(url string) (*http.Response, error) {
c.recordCall(http.MethodDelete, url, nil)
customReturnForAction := c.getCustomReturnForAction(http.MethodDelete)
if customReturnForAction == nil {
return nil
return nil, nil
}
return customReturnForAction.(error)
return customReturnForAction.(*http.Response), nil
}
4 changes: 2 additions & 2 deletions redfish/eventdestination.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ func DeleteEventDestination(c common.Client, uri string) (err error) {
if len(strings.TrimSpace(uri)) == 0 {
return fmt.Errorf("uri should not be empty")
}
resp, err := c.Delete(uri)
defer resp.Body.Close()
_, err = c.Delete(uri)
//defer resp.Body.Close()

return err
}
Expand Down

0 comments on commit 2e0a1d3

Please sign in to comment.