Skip to content

Commit fe85374

Browse files
committed
Simple run_pymodules_install test, refs kivy#1898
Regression test for the fix introduced in kivy#1898.
1 parent e6a6271 commit fe85374

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_build.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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')

0 commit comments

Comments
 (0)