-
Notifications
You must be signed in to change notification settings - Fork 64
tests: match request body #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report
|
tests/test_utils.go
Outdated
| if strings.HasPrefix(r.Header["Content-Type"][0], "multipart/form-data") { | ||
| fmt.Printf("skip %s ??? %s", b.String(), i.Body) | ||
| return true | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a hot fix for multipart/form-data that are not exactly the same for some reason even when the content is the same.
tests/test_utils.go
Outdated
| fmt.Printf("skip %s ??? %s", b.String(), i.Body) | ||
| return true | ||
| } | ||
| matched := (b.String() == "" || b.String() == i.Body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it a match if the body is empty and different than the recorded body ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's related to GET requests that do not contain body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But shouldn't it be equal to the recorded body i.Body anyway ?
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Request body must match recorded one in cassettes.