Introduce httpretty for unittest to mock Appium server#281
Merged
KazuCocoa merged 18 commits intoappium:masterfrom Nov 30, 2018
Merged
Introduce httpretty for unittest to mock Appium server#281KazuCocoa merged 18 commits intoappium:masterfrom KazuCocoa:introduce-httpretty-for-unittestKazuCocoa/python-client:introduce-httpretty-for-unittest
KazuCocoa merged 18 commits intoappium:masterfrom
KazuCocoa:introduce-httpretty-for-unittestKazuCocoa/python-client:introduce-httpretty-for-unittest
Conversation
Member
|
This is a good idea. You could also write tests against Appium's FakeDriver to get a "real" driver that does nothing :-) |
Member
Author
|
ah, gotha. => https://github.com/appium/appium/blob/master/lib/appium.js#L30 |
VenkateshPS
approved these changes
Nov 30, 2018
Contributor
There was a problem hiding this comment.
Ran added test methods on python 2.7 and 3.7. All Passed.
Closed
This file contains hidden or 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
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.
As Python, we must take care of compatibility of 2.x and 3.x.
e.g. https://github.com/appium/python-client/pull/267/files
Currently, this project has many functional tests which need Appium server. But we can uncover such issues with dynamic tests like this PR's approach,
test_clipboard. This approach is using a mock server to simulate Appium server using httpretty for unit tests. We do not need to run the functional tests every PR to ensure the compatibility of Python 2 and 3 with this approach.If we have no https://github.com/appium/python-client/pull/267/files , the test case can fail like below with Python 3.x
I have maintained this approach in ruby_lib_core. It works fine to ensure client-side behaviour stably and short.
I would like to clean this code if this approach is reasonable for us.
I will ask this approach in slack channel.