Commit graph

18 commits

Author SHA1 Message Date
Andre Miras
10a2fb9848 🗑️ Removes Python 2 constructions
- Drops Python 2 imports
- Drops `if IS_PY3` constructions
- Drops `object` inheritance
- Drops `__future__` imports
- Drops `mocks` dependency
- Uses Python 3 `super()`
2020-05-18 23:09:51 +02:00
Andre Miras
891e24b6f2 Also tests against macOS platform
Increases coverage from 28% to 30%.
2020-04-25 18:21:10 +02:00
Andre Miras
757941aabb Unit tests TargetAndroid.build_package()
Increases android.py coverage from 24% to 36% and total coverage from
25% to 29%.
Note that this tests would have caught the glob issue reported in #1044.
2020-04-13 21:27:13 +02:00
Andre Miras
5f35e8b409 F841: local variable is assigned to but never used 2020-04-13 17:38:32 +02:00
Andre Miras
0c4116c469 Starts unit testing buildozer/targets/android.py
This is a best effort approach trying to increase the coverage of that
module. Therefore some tests are not completely isolating all
dependencies via `mock.patch`-ing.
Subsequent pull request could cover more methods and focus on edge case.
This increases the overall coverage from 20% to 25% and
`buildozer/targets/android.py` coverage from 15% to `24%`.
2020-04-10 21:12:52 +02:00
Andre Miras
8e56f880ce Fixes test_p4a_recommended_android_ndk_found() mocking
Mocking `for line in open()` should be done via `StringIO`.
Also uses `pytest` in `tox.ini` so assert errors are more verbose.
2019-10-05 15:01:18 +02:00
Alexander Taylor
9fcf28ba44 Code improvements around NDK download (#961)
* Cleaned up some variable references
* Improved how user build dir is accessed
* Minor code style improvements
* Fixed dist_dir calculation following p4a changes
2019-10-05 13:34:49 +02:00
opacam
8dd22bd4d4 [p4a] Add ability to get p4a's recommended android's NDK version
Only if the p4a version used has the file `pythonforandroid/recommendations.py`, which contains the info we want, otherwise we will return the buildozer's one
2019-08-24 11:45:10 +02:00
Andre Miras
11b733cbd9 Unit test unicode decode on command output, fixes #857
Also fixes stderr/stdout writing refs #743.
2019-05-28 22:32:10 +02:00
Alexander Taylor
81b6ac51a3
Merge pull request #860 from robertpro/master
Download Apache ANT at the same path as the buildozer.spec android.ant_path option
2019-05-26 14:03:48 +01:00
Andre Miras
586152c6ce Exits with error code on build exception, fixes #674 2019-04-17 22:25:30 +02:00
José Roberto Meza Cabrera
5540f84452 Added Android ANT path test 2019-03-17 19:05:55 -06:00
Andre Miras
5cde0b0f92 Changes default log level to debug (2)
Helps with troubleshooting and error reporting.
Also closes #824
2019-03-12 20:04:13 +01:00
Andre Miras
831d85a5e0 Handles unknown command/target error gracefully, closes #812
Running `buildozer unknown_command` should show a meaningful error and
exit. Fixes regression introduced in 4936d31 and adds unit tests.

Also updates other tests `assert` keyword rather than `self.assert*` in
order to keep style consistent.

Last, minor `Dockerfile` documentation update as per recent @tshirtman
feedback.
2019-03-12 19:31:46 +01:00
Andre Miras
9c137b06a7 Unit test logger
- adds test utils methods
- checks default log level
- sets log level via spec file
- checks messages printing depending on level
2019-02-17 18:10:18 +01:00
Andre Miras
0d22e60e2e Unit tests buildozer --help command, refs #813
This test should fail due to #813. Next commit will fix it.
2019-02-08 18:53:34 +01:00
Andre Miras
27d8880411 Unit tests read spec file, refs #793 2019-01-21 18:55:48 +01:00
Andre Miras
58faefa243 Introduces CI and tox testing, fixes #679
- run setup.py on both Python2 and Python3
- runs simple test case for both Python2 and Python3
- checks the PEP8 style
- updates README.md adds Travis badge
2019-01-16 23:16:29 +01:00