Skip to content

Commit

Permalink
Merge pull request #71 from programmfabrik/dont_overwrite_format_with…
Browse files Browse the repository at this point in the history
…_unset

don't overwrite format if unset (see #63710)
  • Loading branch information
martinrode authored Feb 10, 2022
2 parents 1cc6ee0 + 65cb10e commit c97252d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api_testcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ func (testCase Case) breakResponseIsPresent(request api.Request, response api.Re
return false, fmt.Errorf("error loading check response from spec: %s", err)
}

response.Format = expectedResponse.Format
if expectedResponse.Format.Type != "" {
response.Format = expectedResponse.Format
} else {
expectedResponse.Format = response.Format
}

responsesMatch, err := testCase.responsesEqual(expectedResponse, response)
if err != nil {
Expand Down Expand Up @@ -192,7 +196,11 @@ func (testCase *Case) checkCollectResponse(request api.Request, response api.Res
return -1, fmt.Errorf("error loading check response from spec: %s", err)
}

response.Format = expectedResponse.Format
if expectedResponse.Format.Type != "" {
response.Format = expectedResponse.Format
} else {
expectedResponse.Format = response.Format
}

responsesMatch, err := testCase.responsesEqual(expectedResponse, response)
if err != nil {
Expand Down

0 comments on commit c97252d

Please sign in to comment.