Skip to content

Commit 0fb6df5

Browse files
committed
✅ Update tests to work with refactored python3 recipe
1 parent 1444ba4 commit 0fb6df5

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/test_bootstrap.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,6 @@ def bootstrap_name(self):
371371
@mock.patch("pythonforandroid.bootstraps.webview.open", create=True)
372372
@mock.patch("pythonforandroid.bootstraps.sdl2.open", create=True)
373373
@mock.patch("pythonforandroid.distribution.open", create=True)
374-
@mock.patch(
375-
"pythonforandroid.python.GuestPythonRecipe.create_python_bundle"
376-
)
377374
@mock.patch("pythonforandroid.bootstrap.Bootstrap.strip_libraries")
378375
@mock.patch("pythonforandroid.util.exists")
379376
@mock.patch("pythonforandroid.util.chdir")
@@ -388,7 +385,6 @@ def test_run_distribute(
388385
mock_chdir,
389386
mock_ensure_dir,
390387
mock_strip_libraries,
391-
mock_create_python_bundle,
392388
mock_open_dist_files,
393389
mock_open_sdl2_files,
394390
mock_open_webview_files,
@@ -420,6 +416,7 @@ def test_run_distribute(
420416

421417
self.ctx.hostpython = "/some/fake/hostpython3"
422418
self.ctx.python_recipe = Recipe.get_recipe("python3", self.ctx)
419+
self.ctx.python_recipe.create_python_bundle = mock.MagicMock()
423420
self.ctx.python_modules = ["requests"]
424421
self.ctx.archs = [ArchARMv7_a(self.ctx)]
425422

@@ -462,7 +459,16 @@ def test_run_distribute(
462459
mock_chdir.assert_called()
463460
mock_listdir.assert_called()
464461
mock_strip_libraries.assert_called()
465-
mock_create_python_bundle.assert_called()
462+
expected__python_bundle = os.path.join(
463+
self.ctx.dist_dir,
464+
f"{self.ctx.bootstrap.distribution.name}__{self.TEST_ARCH}",
465+
"_python_bundle",
466+
"_python_bundle",
467+
)
468+
self.assertIn(
469+
mock.call(expected__python_bundle, self.ctx.archs[0]),
470+
self.ctx.python_recipe.create_python_bundle.call_args_list,
471+
)
466472

467473
@mock.patch("pythonforandroid.bootstrap.shprint")
468474
@mock.patch("pythonforandroid.bootstrap.glob.glob")

0 commit comments

Comments
 (0)