Skip to content
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

Demonstrates Android HTTPS via urllib module #1

Merged
merged 1 commit into from
Jun 8, 2019

Conversation

AndreMiras
Copy link
Contributor

Creates a unit test that shows setting SSL_CERT_DIR is mandatory.
Refs kivy/python-for-android#1827

Running the app on Android should produce the following output:

06-08 02:30:30.302 30934 31115 I python  : Android kivy bootstrap done.
__name__ is __main__
06-08 02:30:30.302 30934 31115 I python  : AND: Ran string
06-08 02:30:30.302 30934 31115 I python  : Run user program, change dir
and execute entrypoint

06-08 02:30:31.094 30934 31115 I python  : [WARNING] [Config      ]
Older configuration version detected (0 instead of 21)
06-08 02:30:31.094 30934 31115 I python  : [WARNING] [Config      ]
Upgrading configuration in progress.
06-08 02:30:31.103 30934 31115 I python  : [INFO   ] [Logger      ]
Record log in
/data/user/0/org.httpsapp.httpsapp/files/app/.kivy/logs/kivy_19-06-08_0.txt
06-08 02:30:31.103 30934 31115 I python  : [INFO   ] [Kivy        ]
v1.11.0.dev0, git-d562ecc, 20190607
06-08 02:30:31.103 30934 31115 I python  : [INFO   ] [Python      ]
v3.7.1 (default, Jun  8 2019, 01:44:06)
06-08 02:30:31.103 30934 31115 I python  : [Clang 6.0.2
(https://android.googlesource.com/toolchain/clang 183abd29fc496f55
06-08 02:30:31.120 30934 31115 I python  :
/data/user/0/org.httpsapp.httpsapp/files/app/_python_bundle/site-packages/requests/models.py:176:
DeprecationWarning: Using or importing the ABCs from 'collections'
instead of from 'collections.abc' is deprecated, and in 3.8 it will stop
working
06-08 02:30:31.581 30934 31115 I python  :  ..
06-08 02:30:31.582 30934 31115 I python  :
----------------------------------------------------------------------
06-08 02:30:31.582 30934 31115 I python  :  Ran 2 tests in 0.467s
06-08 02:30:31.583 30934 31115 I python  :
06-08 02:30:31.584 30934 31115 I python  :  OK

Creates a unit test that shows setting `SSL_CERT_DIR` is mandatory.
Refs kivy/python-for-android#1827

Running the app on Android should produce the following output:
```
06-08 02:30:30.302 30934 31115 I python  : Android kivy bootstrap done.
__name__ is __main__
06-08 02:30:30.302 30934 31115 I python  : AND: Ran string
06-08 02:30:30.302 30934 31115 I python  : Run user program, change dir
and execute entrypoint

06-08 02:30:31.094 30934 31115 I python  : [WARNING] [Config      ]
Older configuration version detected (0 instead of 21)
06-08 02:30:31.094 30934 31115 I python  : [WARNING] [Config      ]
Upgrading configuration in progress.
06-08 02:30:31.103 30934 31115 I python  : [INFO   ] [Logger      ]
Record log in
/data/user/0/org.httpsapp.httpsapp/files/app/.kivy/logs/kivy_19-06-08_0.txt
06-08 02:30:31.103 30934 31115 I python  : [INFO   ] [Kivy        ]
v1.11.0.dev0, git-d562ecc, 20190607
06-08 02:30:31.103 30934 31115 I python  : [INFO   ] [Python      ]
v3.7.1 (default, Jun  8 2019, 01:44:06)
06-08 02:30:31.103 30934 31115 I python  : [Clang 6.0.2
(https://android.googlesource.com/toolchain/clang 183abd29fc496f55
06-08 02:30:31.120 30934 31115 I python  :
/data/user/0/org.httpsapp.httpsapp/files/app/_python_bundle/site-packages/requests/models.py:176:
DeprecationWarning: Using or importing the ABCs from 'collections'
instead of from 'collections.abc' is deprecated, and in 3.8 it will stop
working
06-08 02:30:31.581 30934 31115 I python  :  ..
06-08 02:30:31.582 30934 31115 I python  :
----------------------------------------------------------------------
06-08 02:30:31.582 30934 31115 I python  :  Ran 2 tests in 0.467s
06-08 02:30:31.583 30934 31115 I python  :
06-08 02:30:31.584 30934 31115 I python  :  OK
```
@AndreMiras
Copy link
Contributor Author

So yes I've adopted a different approach than the initial demo app.
Here I'm documenting the bug/feature via unit tests. I show that it's expected to fail without loading the environment variable. Then I later show it's working while loading it.
If you prefer the demo app approach it's also fine 👍

@Sirfanas Sirfanas merged commit 0538bbd into Sirfanas:master Jun 8, 2019
@AndreMiras AndreMiras deleted the feature/demo_as_unittest branch June 8, 2019 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants