From 754db4cc410b9bd4b0aa23e3f5ab03e31f867fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A7=80=ED=9B=88?= <155136709+dlwlgnsrhy@users.noreply.github.com> Date: Thu, 19 Nov 2026 08:37:17 +0900 Subject: [PATCH] test(integrations): make unknown integration checks independent of network Use the existing catalog test helper to supply an empty successful response when testing init, install and switch with an unknown integration. Assisted-by: OpenAI Codex (model: GPT-6.2, autonomous) --- tests/integrations/test_cli.py | 5 +++-- tests/specify_cli/integrations/test_command_install.py | 5 +++-- tests/specify_cli/integrations/test_command_switch.py | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/integrations/test_cli.py b/tests/integrations/test_cli.py index a2290d956d..5fc3b0ad8a 100644 --- a/tests/integrations/test_cli.py +++ b/tests/integrations/test_cli.py @@ -44,8 +44,9 @@ def test_cli_phase_label_includes_target(self): ) -class TestInitIntegrationFlag: - def test_unknown_integration_rejected(self, tmp_path): +class TestInitIntegrationFlag(IntegrationCatalogCliTestBase): + def test_unknown_integration_rejected(self, tmp_path, monkeypatch): + self._patch_catalog(monkeypatch, integrations=[]) from typer.testing import CliRunner from specify_cli import app runner = CliRunner() diff --git a/tests/specify_cli/integrations/test_command_install.py b/tests/specify_cli/integrations/test_command_install.py index 568ea8bbd8..bf1a74544f 100644 --- a/tests/specify_cli/integrations/test_command_install.py +++ b/tests/specify_cli/integrations/test_command_install.py @@ -25,7 +25,7 @@ runner, # noqa: F401 ) -class TestIntegrationInstall: +class TestIntegrationInstall(IntegrationCatalogCliTestBase): @pytest.mark.parametrize("existing_target", [True, False]) @pytest.mark.parametrize("allow_symlinks", [False, True]) @pytest.mark.parametrize("contained_target", [False, True]) @@ -82,7 +82,8 @@ def test_install_requires_speckit_project(self, tmp_path): assert result.exit_code != 0 assert "Not a Spec Kit project" in result.output - def test_install_unknown_integration(self, tmp_path): + def test_install_unknown_integration(self, tmp_path, monkeypatch): + self._patch_catalog(monkeypatch, integrations=[]) project = _init_project(tmp_path) old_cwd = os.getcwd() try: diff --git a/tests/specify_cli/integrations/test_command_switch.py b/tests/specify_cli/integrations/test_command_switch.py index 5b5d2bd1a4..fab2754530 100644 --- a/tests/specify_cli/integrations/test_command_switch.py +++ b/tests/specify_cli/integrations/test_command_switch.py @@ -59,7 +59,7 @@ def _project_file_state(project): } -class TestIntegrationSwitch: +class TestIntegrationSwitch(IntegrationCatalogCliTestBase): @pytest.mark.skipif( os.name == "nt", reason="POSIX execute bits are not meaningful on Windows" ) @@ -357,7 +357,8 @@ def test_switch_requires_speckit_project(self, tmp_path): assert result.exit_code != 0 assert "Not a Spec Kit project" in result.output - def test_switch_unknown_target(self, tmp_path): + def test_switch_unknown_target(self, tmp_path, monkeypatch): + self._patch_catalog(monkeypatch, integrations=[]) project = _init_project(tmp_path) old_cwd = os.getcwd() try: