File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,14 @@ FROM ubuntu:18.04
19
19
20
20
ENV ANDROID_HOME="/opt/android"
21
21
22
+ # configure locale
23
+ RUN apt update -qq > /dev/null && apt install -qq --yes --no-install-recommends \
24
+ locales && \
25
+ locale-gen en_US.UTF-8
26
+ ENV LANG="en_US.UTF-8" \
27
+ LANGUAGE="en_US.UTF-8" \
28
+ LC_ALL="en_US.UTF-8"
29
+
22
30
RUN apt -y update -qq \
23
31
&& apt -y install -qq --no-install-recommends curl unzip ca-certificates \
24
32
&& apt -y autoremove
Original file line number Diff line number Diff line change @@ -19,6 +19,14 @@ FROM ubuntu:18.04
19
19
20
20
ENV ANDROID_HOME = "/opt/android"
21
21
22
+ # configure locale
23
+ RUN apt update - qq > / dev / null & & apt install - qq - - yes - - no - install - recommends \
24
+ locales & & \
25
+ locale - gen en_US .UTF - 8
26
+ ENV LANG = "en_US.UTF-8" \
27
+ LANGUAGE = "en_US.UTF-8" \
28
+ LC_ALL = "en_US.UTF-8"
29
+
22
30
RUN apt - y update - qq \
23
31
& & apt - y install - qq - - no - install - recommends curl unzip ca - certificates \
24
32
& & apt - y autoremove
Original file line number Diff line number Diff line change
1
+ import unittest
2
+ from mock import MagicMock
3
+ from pythonforandroid import logger
4
+
5
+
6
+ class TestShprint (unittest .TestCase ):
7
+
8
+ def test_unicode_encode (self ):
9
+ """
10
+ Makes sure `shprint()` can handle unicode command output.
11
+ Running the test with PYTHONIOENCODING=ASCII env would fail, refs:
12
+ https://github.com/kivy/python-for-android/issues/1654
13
+ """
14
+ expected_command_output = ["foo\xa0 bar" ]
15
+ command = MagicMock ()
16
+ command .return_value = expected_command_output
17
+ output = logger .shprint (command , 'a1' , k1 = 'k1' )
18
+ self .assertEqual (output , expected_command_output )
You can’t perform that action at this time.
0 commit comments