File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 1
1
import unittest
2
- import sys
2
+ from unittest import mock
3
3
4
4
from pythonforandroid .androidndk import AndroidNDK
5
5
@@ -15,13 +15,17 @@ def setUp(self):
15
15
perform our unittests"""
16
16
self .ndk = AndroidNDK ("/opt/android/android-ndk" )
17
17
18
- def test_host_tag (self ):
18
+ @mock .patch ("sys.platform" , "linux" )
19
+ def test_host_tag_linux (self ):
19
20
"""Test the `host_tag` property of the :class:`~pythonforandroid.androidndk.AndroidNDK`
20
- class."""
21
- if sys .platform == "linux" :
22
- self .assertEqual (self .ndk .host_tag , "linux-x86_64" )
23
- elif sys .platform == "darwin" :
24
- self .assertEqual (self .ndk .host_tag , "darwin-x86_64" )
21
+ class when the host is Linux."""
22
+ self .assertEqual (self .ndk .host_tag , "linux-x86_64" )
23
+
24
+ @mock .patch ("sys.platform" , "darwin" )
25
+ def test_host_tag_darwin (self ):
26
+ """Test the `host_tag` property of the :class:`~pythonforandroid.androidndk.AndroidNDK`
27
+ class when the host is Darwin."""
28
+ self .assertEqual (self .ndk .host_tag , "darwin-x86_64" )
25
29
26
30
def test_llvm_prebuilt_dir (self ):
27
31
"""Test the `llvm_prebuilt_dir` property of the
You can’t perform that action at this time.
0 commit comments