File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ import unittest
2
+
3
+ try :
4
+ from unittest import mock
5
+ except ImportError :
6
+ # `Python 2` or lower than `Python 3.3` does not
7
+ # have the `unittest.mock` module built-in
8
+ import mock
9
+ from pythonforandroid .build import run_pymodules_install
10
+
11
+
12
+ class TestBuildBasic (unittest .TestCase ):
13
+
14
+ def test_run_pymodules_install_optional_project_dir (self ):
15
+ """
16
+ Makes sure the `run_pymodules_install()` doesn't crash when the
17
+ `project_dir` optional parameter is None, refs #1898
18
+ """
19
+ ctx = mock .Mock ()
20
+ modules = []
21
+ project_dir = None
22
+ with mock .patch ('pythonforandroid.build.info' ) as m_info :
23
+ assert run_pymodules_install (ctx , modules , project_dir ) is None
24
+ assert m_info .call_args_list [- 1 ] == mock .call (
25
+ 'No Python modules and no setup.py to process, skipping' )
You can’t perform that action at this time.
0 commit comments