@@ -19,6 +19,7 @@ def test_run_pymodules_install_optional_project_dir(self):
1919 """
2020 ctx = mock .Mock (recipe_build_order = [])
2121 ctx .archs = [ArchARMv7_a (ctx ), ArchAarch_64 (ctx )]
22+ ctx .extra_index_urls = []
2223 modules = []
2324 project_dir = None
2425 with mock .patch ('pythonforandroid.build.info' ) as m_info :
@@ -58,37 +59,6 @@ def test_is_wheel_compatible(self):
5859 assert not is_wheel_compatible ("test-7.1.0-0-cp313-cp313-some_other_os.whl" , arch , ctx )
5960 assert not is_wheel_compatible ("mmh3-5.2.0-cp314-cp314t-win_amd64.whl" , arch , ctx )
6061
61- def test_strip_if_with_debug_symbols (self ):
62- ctx = mock .Mock (recipe_build_order = [])
63- ctx .python_recipe .major_minor_version_string = "3.6"
64- ctx .get_site_packages_dir .return_value = "test-doesntexist"
65- ctx .build_dir = "nonexistant_directory"
66- ctx .extra_index_urls = []
67- ctx .archs = [ArchAarch_64 (ctx )]
68-
69- modules = ["mymodule" ]
70- project_dir = None
71- with mock .patch ('pythonforandroid.build.info' ), \
72- mock .patch ('sh.Command' ), \
73- mock .patch ('pythonforandroid.build.open' ), \
74- mock .patch ('pythonforandroid.build.shprint' ), \
75- mock .patch ('pythonforandroid.build.current_directory' ), \
76- mock .patch ('pythonforandroid.build.CythonRecipe' ) as m_CythonRecipe , \
77- mock .patch ('pythonforandroid.build.project_has_setup_py' ) as m_project_has_setup_py , \
78- mock .patch ('pythonforandroid.build.run_setuppy_install' ):
79- m_project_has_setup_py .return_value = False
80-
81- # Make sure it is NOT called when `with_debug_symbols` is true:
82- ctx .with_debug_symbols = True
83- assert run_pymodules_install (ctx , ctx .archs [0 ], modules , project_dir ) is None
84- assert m_CythonRecipe ().strip_object_files .called is False
85-
86- # Make sure strip object files IS called when
87- # `with_debug_symbols` is false:
88- ctx .with_debug_symbols = False
89- assert run_pymodules_install (ctx , ctx .archs [0 ], modules , project_dir ) is None
90- assert m_CythonRecipe ().strip_object_files .called is True
91-
9262
9363class TestTemplates (unittest .TestCase ):
9464
0 commit comments