From 374f4ed745dc46f47bff9915768550c198707854 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 16 Dec 2025 13:30:19 +0100 Subject: [PATCH] test(integration): move create repo preview test from e2e and mock git commands - Reclassify create repo preview test as integration test - Rename test class to drop E2E naming - Replace subprocess mock with core.git command mocks (init/add_all/commit) - Patch get_config_value to avoid git config dependency https://chatgpt.com/share/694150de-873c-800f-a01d-df3cc7ce25df --- .../test_repos_create_preview_output.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) rename tests/{e2e => integration}/test_repos_create_preview_output.py (81%) diff --git a/tests/e2e/test_repos_create_preview_output.py b/tests/integration/test_repos_create_preview_output.py similarity index 81% rename from tests/e2e/test_repos_create_preview_output.py rename to tests/integration/test_repos_create_preview_output.py index 5952c73..22a833b 100644 --- a/tests/e2e/test_repos_create_preview_output.py +++ b/tests/integration/test_repos_create_preview_output.py @@ -8,7 +8,7 @@ from unittest.mock import patch from pkgmgr.actions.repository.create import create_repo -class TestE2ECreateRepoPreviewOutput(unittest.TestCase): +class TestCreateRepoPreviewOutput(unittest.TestCase): def test_create_repo_preview_prints_expected_steps(self) -> None: cfg = {"directories": {"repositories": "/tmp/Repositories"}, "repositories": []} @@ -22,7 +22,10 @@ class TestE2ECreateRepoPreviewOutput(unittest.TestCase): patch("pkgmgr.actions.repository.create.render_default_templates"), patch("pkgmgr.actions.repository.create.write_mirrors_file"), patch("pkgmgr.actions.repository.create.setup_mirrors"), - patch("pkgmgr.actions.repository.create.subprocess.run"), + patch("pkgmgr.actions.repository.create.get_config_value", return_value=None), + patch("pkgmgr.actions.repository.create.init"), + patch("pkgmgr.actions.repository.create.add_all"), + patch("pkgmgr.actions.repository.create.commit"), ): create_repo( "github.com/acme/repo",