Skip to content

Commit

Permalink
Merge pull request #1899 from AndreMiras/feature/ticket1898_run_pymod…
Browse files Browse the repository at this point in the history
…ules_install_regression_test

Simple run_pymodules_install test, refs #1898
  • Loading branch information
inclement authored Jun 29, 2019
2 parents e6a6271 + 8b3e218 commit 4b4e899
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import unittest

try:
from unittest import mock
except ImportError:
# `Python 2` or lower than `Python 3.3` does not
# have the `unittest.mock` module built-in
import mock
from pythonforandroid.build import run_pymodules_install


class TestBuildBasic(unittest.TestCase):

def test_run_pymodules_install_optional_project_dir(self):
"""
Makes sure the `run_pymodules_install()` doesn't crash when the
`project_dir` optional parameter is None, refs #1898
"""
ctx = mock.Mock()
modules = []
project_dir = None
with mock.patch('pythonforandroid.build.info') as m_info:
assert run_pymodules_install(ctx, modules, project_dir) is None
assert m_info.call_args_list[-1] == mock.call(
'No Python modules and no setup.py to process, skipping')

0 comments on commit 4b4e899

Please sign in to comment.