Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/vhs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 7 additions & 1 deletion tests/test_cli/test_cli_groups/test_config_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 3 additions & 4 deletions tests/test_cli/test_cli_groups/test_exec_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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])
Expand Down
Loading