-
Notifications
You must be signed in to change notification settings - Fork 77
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
Feature/python3 update #63
Open
jerry57
wants to merge
36
commits into
peritus:master
Choose a base branch
from
jerry57:feature/Python3_Update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added a simply echo server to the mock server (copied from POST statement). Added a test in simple.txt test framework. Moved the old 'Custom HTTP' verb test to use OPTIONS instead of PATCH.
… take use a variable as a parameter for the GET command. Remove the quotes if needed.
Added OPTIONS as main keyword
Keep the symmetry with set_request_body() which encodes the unicode object (Robot Framework defaults to unicode for all strings) into an instance of str by decoding the response into an instance of unicode in get_response_body(). Failure to do so causes UnicodeDecodeErrors in all keywords that compare the response body against a given string if any of the two contains Unicode characters.
Robot Framework defaults to unicode objects for all strings created. As a result, httplib.py:848 has unicode += str (msg += message_body) which crashes with UnicodeDecodeError when the body contains Unicode characters: File "/usr/lib64/python2.7/httplib.py", line 1001, in request self._send_request(method, url, body, headers) File "/usr/lib64/python2.7/httplib.py", line 1035, in _send_request self.endheaders(body) File "/usr/lib64/python2.7/httplib.py", line 997, in endheaders self._send_output(message_body) File "/usr/lib64/python2.7/httplib.py", line 848, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 32: ordinal not in range(128) A similar stack trace has been posted as part of Python bug #11898 [1] (duplicated by #12398 [2]) which has later been closed as a programming error. Both robotframework-httplibrary and webtest treat the 'Content-Type' header special which results in surprising behavior regarding the tests: Had the 'Accept' header been removed from the provided test case no UnicodeDecodeError would have been thrown in httplib.py:848. Turning unicode objects into str objects is the right thing to do according to the HTTP standard ([3], updated by [5]) because it requires conformity to MIME [5] (hint by [6]). [1] http://bugs.python.org/issue11898 [2] http://bugs.python.org/issue12398 [3] https://tools.ietf.org/html/rfc2616 [4] https://tools.ietf.org/html/rfc2047 [5] https://tools.ietf.org/html/rfc7230 [6] https://stackoverflow.com/a/5426648
Honors Robot Framework formatting on Github.
fixed set_json_value method when json_value has a string
- Improvement: Added stringify parameter to json_value_should_equal and json_value_should_not_equal methods
This will remove the specified JSON key from JSON. Till not we had only "set_json_value".
Oldest fix delete
jverhoeven PRs
Topic/support bodies with unicode
Changed extension to .robot for Github formatting.
vikulin PRs
Added function remove_json_key
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.