8000 :white_check_mark: Update tests to work with refactored `python3` recipe · kivy/python-for-android@e442905 · GitHub
[go: up one dir, main page]

Skip to content

Commit e442905

Browse files
committed
✅ Update tests to work with refactored python3 recipe
1 parent c1662cb commit e442905

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
@@ -366,9 +366,6 @@ def bootstrap_name(self):
366366
@mock.patch("pythonforandroid.bootstraps.webview.open", create=True)
367367
@mock.patch("pythonforandroid.bootstraps.sdl2.open", create=True)
368368
@mock.patch("pythonforandroid.distribution.open", create=True)
369-
@mock.patch(
370-
"pythonforandroid.python.GuestPythonRecipe.create_python_bundle"
371-
)
372369
@mock.patch("pythonforandroid.bootstrap.Bootstrap.strip_libraries")
373370
@mock.patch("pythonforandroid.util.exists")
374371
@mock.patch("pythonforandroid.util.chdir")
@@ -383,7 +380,6 @@ def test_run_distribute(
383380
mock_chdir,
384381
mock_ensure_dir,
385382
mock_strip_libraries,
386-
mock_create_python_bundle,
387383
mock_open_dist_files,
388384
mock_open_sdl2_files,
389385
mock_open_webview_files,
@@ -415,6 +411,7 @@ def test_run_distribute(
415411

416412
self.ctx.hostpython = "/some/fake/hostpython3"
417413
self.ctx.python_recipe = Recipe.get_recipe("python3", self.ctx)
414+
self.ctx.python_recipe.create_python_bundle = mock.MagicMock()
418415
self.ctx.python_modules = ["requests"]
419416
self.ctx.archs = [ArchARMv7_a(self.ctx)]
420417

@@ -457,7 +454,16 @@ def test_run_distribute(
457454
mock_chdir.assert_called()
458455
mock_listdir.assert_called()
459456
mock_strip_libraries.assert_called()
460-
mock_create_python_bundle.assert_called()
457+
expected__python_bundle = os.path.join(
458+
self.ctx.dist_dir,
459+
f"{self.ctx.bootstrap.distribution.name}__{self.TEST_ARCH}",
460+
"_python_bundle",
461+
"_python_bundle",
462+
)
463+
self.assertIn(
464+
mock.call(expected__python_bundle, self.ctx.archs[0]),
465+
self.ctx.python_recipe.create_python_bundle.call_args_list,
466+
)
461467

462468
@mock.patch("pythonforandroid.bootstrap.shprint")
463469
@mock.patch("pythonforandroid.bootstrap.glob.glob")

0 commit comments

Comments
 (0)
0