Skip to content

Commit

Permalink
[ISSUE-70] Possibility to not fail the test during retries
Browse files Browse the repository at this point in the history
  • Loading branch information
siller174 committed Apr 19, 2024
1 parent 2f363eb commit 3065426
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions roundtripper.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,13 @@ func (it *Test) doRequest(t T, baseReq *http.Request) (*http.Response, error) {
return resp, nil
}

func (it *Test) validateResponseCode(resp *http.Response) cuteErrors.AssertError {
func (it *Test) validateResponseCode(resp *http.Response) error {
if it.Expect.Code != 0 && it.Expect.Code != resp.StatusCode {
err := cuteErrors.NewAssertError(
return cuteErrors.NewAssertError(
"Assert response code",
fmt.Sprintf("Response code expect %v, but was %v", it.Expect.Code, resp.StatusCode),
resp.StatusCode,
it.Expect.Code)

// it's safe to cast to AssertError, because we create it in this function
return err.(cuteErrors.AssertError)
}

return nil
Expand Down

0 comments on commit 3065426

Please sign in to comment.