-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 unittest for module pythonforandroid.bootstrap
#1872
Conversation
Awesome, I'll review it pretty soon. |
This is some impressive testing on here, well done @opacam 👍 |
f458b26
to
0cfe7a2
Compare
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.
Nice improvement thanks!
0cfe7a2
to
8bc3803
Compare
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.
Looking good thanks!
I leave it open a couple of days in case you want to discuss/address further the recent comments. Otherwise we're good for a merge, this is a nice improvement
8bc3803
to
9530953
Compare
self.assertIn( | ||
mock.call().__enter__().write("sdk.dir=/opt/android/android-sdk"), | ||
mock_open_bs.mock_calls, | ||
) |
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.
@AndreMiras,
now we test that we actually we write the expected values...this (and the lines below) replaces the read_data
thing that it was wrong 😉
And thanks for reviewing this, your reviews allowed us to improve this pr a lot ❤️, now it looks much cleaner and we do more testing than the first posted version.
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.
That definitely makes more sense to me thanks! 👏
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.
The initial PR was already good, now it's a gem 💎
hanks for your time and patience ❤️
In this
unittest
we will also cover all the bootstraps we have at this time, so this would increase the coverage a little more than the other tests I recently introduced.Also should be mentioned that, in order that to not increase the time of our tox tests, I mocked a lot of functions, so this way the test is performed with less than a second and it covers above a 90% of the lines of the tested files (which I think that should be the final goal for our unittests...above an 90%)
As a side note: I introduced the bootstraps tests in here because our bootstraps (sdl2, webview...) inherits from
Bootstrap