Skip to content
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

fix(target/python) query string fix #138

Merged
merged 4 commits into from May 3, 2019

Conversation

karol-maciaszek
Copy link
Contributor

@karol-maciaszek karol-maciaszek commented Apr 29, 2019

This change fixes handling of query string parameters for python/request target.

Query params can be supplied both by queryString and url (http://www.softwareishard.com/blog/har-12-spec/#request). Both scenarios are supported here https://github.com/Kong/httpsnippet/blob/master/src/index.js#L164.

However python/requests was looking only into queryString which was a cause of bug.

@darrenjennings
Copy link
Contributor

Can you add a test that demonstrates the fixed behavior?

@karol-maciaszek
Copy link
Contributor Author

Sure, just added a test. Also updated description :)

})

result.should.be.a.String()
result.should.eql('import requests\n\nurl = "http://mockbin.com/har"\n\nquerystring = {"param":"value"}\n\nresponse = requests.request("GET", url, params=querystring)\n\nprint(response.text)')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. only feedback is to make output human readable using backticks. I refactored the go tests recently you can use as an example. This helps with git diffs in a future PR if tests fail.

result.should.eql(`package main

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants