From 7ff7f7cd56efa03cb6a3dba4b4dc688702f3951b Mon Sep 17 00:00:00 2001 From: Marco Esters Date: Mon, 25 Nov 2024 14:20:00 -0800 Subject: [PATCH] Update Windows extra page test --- tests/test_examples.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/test_examples.py b/tests/test_examples.py index f16200f44..454d050b8 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -379,8 +379,25 @@ def test_example_customized_welcome_conclusion(tmp_path, request): @pytest.mark.skipif(sys.platform != "win32", reason="Windows only") -def test_example_extra_pages_win(tmp_path, request): - input_path = _example_path("exe_extra_pages") +@pytest.mark.parameterize( + "extra_pages", + pytest.param(["extra_page_1.nsi", "extra_page_2.nsi"], id="two pages"), + pytest.param("extra_page_1.nsi", id="single page"), +) +def test_example_extra_pages_win(tmp_path, request, extra_pages): + recipe_path = _example_path("exe_extra_pages") + input_path = tmp_path / "input" + shutil.copytree(str(recipe_path), str(input_path)) + construct_yaml = input_path / "construct.yaml" + content = construct_yaml.read_text() + if isinstance(extra_pages, str): + content += f"post_install_pages: {extra_pages}\n" + content = content.replace("extraPages", "extraPage") + else: + content += "post_install_pages:\n" + for page in extra_pages: + content += f" - {page}\n" + construct_yaml.write_text(content) for installer, install_dir in create_installer(input_path, tmp_path): _run_installer(input_path, installer, install_dir, request=request)