File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
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 ()
You can’t perform that action at this time.
0 commit comments