-
Notifications
You must be signed in to change notification settings - Fork 572
Introduce httpretty for unittest to mock Appium server #281
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
Introduce httpretty for unittest to mock Appium server #281
Conversation
This is a good idea. You could also write tests against Appium's FakeDriver to get a "real" driver that does nothing :-) |
ah, gotha. => https://github.com/appium/appium/blob/master/lib/appium.js#L30 |
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.
Ran added test methods on python 2.7 and 3.7. All Passed.
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.