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