Skip to content

Commit d4c8260

Browse files
committed
[test] Add test for libgeos
1 parent 059969f commit d4c8260

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/recipes/test_libgeos.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import unittest
2+
from unittest import mock
3+
from tests.recipes.recipe_lib_test import BaseTestForCmakeRecipe
4+
5+
6+
class TestLibgeosRecipe(BaseTestForCmakeRecipe, unittest.TestCase):
7+
"""
8+
An unittest for recipe :mod:`~pythonforandroid.recipes.libgeos`
9+
"""
10+
recipe_name = "libgeos"
11+
12+
@mock.patch("pythonforandroid.util.makedirs")
13+
@mock.patch("pythonforandroid.util.chdir")
14+
@mock.patch("pythonforandroid.build.ensure_dir")
15+
@mock.patch("pythonforandroid.archs.glob")
16+
@mock.patch("pythonforandroid.archs.find_executable")
17+
def test_build_arch(
18+
self,
19+
mock_find_executable,
20+
mock_glob,
21+
mock_ensure_dir,
22+
mock_current_directory,
23+
mock_makedirs,
24+
):
25+
# We overwrite the base test method because we
26+
# want to avoid any file/directory creation
27+
super(TestLibgeosRecipe, self).test_build_arch()
28+
# make sure that the mocked methods are actually called
29+
mock_makedirs.assert_called()

0 commit comments

Comments
 (0)