Skip to content

Commit cd1479f

Browse files
Mia-CrossremyleoneCodelax
authored
added 412 to error codes that are checked (#1306)
Co-authored-by: Rémy Léone <[email protected]> Co-authored-by: Jules Castéran <[email protected]>
1 parent 7d0430b commit cd1479f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scaleway/validate_cassettes_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ func TestAccScalewayCassettes_Validator(t *testing.T) {
4242

4343
func checkErrorCode(c *cassette.Cassette) error {
4444
for _, i := range c.Interactions {
45-
if !checkErrCode(i, c, http.StatusConflict, http.StatusInternalServerError) {
46-
return fmt.Errorf("status: %v founded on %s. method: %s, url %s", i.Code, c.Name, i.Request.Method, i.Request.URL)
45+
if !checkErrCode(i, c, http.StatusConflict, http.StatusInternalServerError, http.StatusPreconditionFailed) {
46+
return fmt.Errorf("status: %v found on %s. method: %s, url %s\nrequest body = %v\nresponse body = %v", i.Code, c.Name, i.Request.Method, i.Request.URL, i.Request.Body, i.Response.Body)
4747
}
4848
}
4949

@@ -67,7 +67,7 @@ func checkErrCode(i *cassette.Interaction, c *cassette.Cassette, codes ...int) b
6767

6868
for _, httpCode := range codes {
6969
if i.Code == httpCode {
70-
return true
70+
return false
7171
}
7272
}
7373

0 commit comments

Comments
 (0)