-
Notifications
You must be signed in to change notification settings - Fork 425
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
Add Dockerfiles for testing, fix tests and style #408
Merged
Merged
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
now with mocked output for UPower
…ses decimal comma
and move dummy facade + platform implementations under the unittest file to keep it in one place
… coveralls.io report
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.
Pretty much first I've attempted to start X11/Xserver/whatever in Docker container, however afaik (and from a lot of similar issues) I think that's not possible without X11 forwarding into the container (which basically kills the whole point), so I switched to a solution where we can add non-X11/non-display dependent binaries into the container and test against those + add some mocks if necessary i.e. something on
plyer/tests/test_battery.py
style.Better said, if the binary we use on GNU/Linux distros provides a useful output and/or we parse something, it'd be really useful to get the full output and mark the versions of a binary it was tested with instead of just mocking (basically - X called with Y? yup... and what now if we need to parse?). If the binary is only like
notify-send
, then just the mocking is safe enough (no better choice afaik at least). Regarding Windows (and perhaps even OSX) the testing there is easy because there is an API and if some window pops out we can check the title, class, etc (see test for Windows atplyer/tests/test_notification.py
).Regarding Android/iOS, we can basically do just the mocking but it'd be nice to at least note the SDK it was tested with, so that if some API disappears we know what happened.
Also I fixed
upower
battery API because previously it parsed everything which if you have multiple batteries or a keyboard with battery or what not it won't provide the right results. I switched to using the deviceBAT0
which has been already specified in that file.I added Pylint too, because I've noticed that with each platform there is a different style of coding and I think in the long run it'll trim the mess and it'll be more readable. And I'm still not sure what's OSX's problem with Py3 because I've run the tests on Ubuntu, Mint, Fedora, in the containers and on Windows, yet OSX kind of irritates me with this silly fail for
reload()
.https://coveralls.io/github/KeyWeeUsr/plyer, https://travis-ci.org/KeyWeeUsr/plyer, the coverage is obviously lower because I removed two dummy files and made it strictly only for the
plyer
package and nothing else.