diff --git a/.github/workflows/vhs.yml b/.github/workflows/vhs.yml index bc513fa3..9921509f 100644 --- a/.github/workflows/vhs.yml +++ b/.github/workflows/vhs.yml @@ -32,7 +32,7 @@ jobs: path: ".github/tape_collection/cli_ssh.tape" # Add gifs to commit - - uses: stefanzweifel/git-auto-commit-action@v5 + - uses: stefanzweifel/git-auto-commit-action@v6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/tests/test_cli/test_cli_groups/test_config_commands.py b/tests/test_cli/test_cli_groups/test_config_commands.py index d9dbe3ba..70959cc0 100644 --- a/tests/test_cli/test_cli_groups/test_config_commands.py +++ b/tests/test_cli/test_cli_groups/test_config_commands.py @@ -100,9 +100,15 @@ def test_output_messages(self): def test_api_key_prompt(self): """Tests the API key prompt.""" - with patch("click.prompt", return_value="KEY") as mock_prompt: + with patch("click.prompt", return_value="KEY") as mock_prompt, patch( + "runpod.cli.groups.config.commands.set_credentials" + ) as mock_set_credentials, patch( + "runpod.cli.groups.config.commands.check_credentials", + return_value=(False, None) + ): result = self.runner.invoke(runpod_cli, ["config", "--profile", "test"]) mock_prompt.assert_called_with( " > RunPod API Key", hide_input=False, confirmation_prompt=False ) # pylint: disable=line-too-long + mock_set_credentials.assert_called_with("KEY", "test", overwrite=True) assert result.exit_code == 0 diff --git a/tests/test_cli/test_cli_groups/test_exec_commands.py b/tests/test_cli/test_cli_groups/test_exec_commands.py index 9b04528e..d8a0edf6 100644 --- a/tests/test_cli/test_cli_groups/test_exec_commands.py +++ b/tests/test_cli/test_cli_groups/test_exec_commands.py @@ -7,14 +7,15 @@ from unittest.mock import patch import click +from click.testing import CliRunner from runpod.cli.entry import runpod_cli class TestExecCommands(unittest.TestCase): """Tests for Runpod CLI exec commands.""" - def setUp(self): + self.runner = CliRunner() self.runner = click.testing.CliRunner() def test_remote_python_with_provided_pod_id(self): @@ -49,9 +50,7 @@ def test_remote_python_without_provided_pod_id_prompt(self): "runpod.cli.groups.exec.commands.python_over_ssh" ) as mock_python_over_ssh, patch( "runpod.cli.groups.exec.commands.get_session_pod", - side_effect=lambda: click.prompt( - "Please provide the pod ID", "prompted_pod_id" - ), + return_value="prompted_pod_id", ) as mock_get_pod_id: # pylint: disable=line-too-long mock_python_over_ssh.return_value = None result = self.runner.invoke(runpod_cli, ["exec", "python", temp_file.name])