Skip to content

Commit 5bc87c2

Browse files
committed
fix: missing test
1 parent ef8d888 commit 5bc87c2

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

runpod/cli/groups/project/commands.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
'''
44

55
import os
6+
import sys
67
import click
78
from InquirerPy import prompt as cli_select
89

@@ -30,6 +31,7 @@ def new_project_wizard(project_name, model_type, model_name, init_current_dir):
3031
if len(network_volumes) == 0:
3132
click.echo("You do not have any network volumes.")
3233
click.echo("Please create a network volume (https://runpod.io/console/user/storage) and try again.") # pylint: disable=line-too-long
34+
sys.exit(1)
3335

3436
click.echo("Creating a new project...")
3537

tests/test_cli/test_cli_groups/test_project_commands.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ class TestProjectCLI(unittest.TestCase):
1616
def setUp(self):
1717
self.runner = CliRunner()
1818

19+
def test_new_project_wizard_no_network_volumes(self):
20+
'''
21+
Tests the new_project_wizard command with no network volumes.
22+
'''
23+
with patch('runpod.cli.groups.project.commands.get_user') as mock_get_user:
24+
mock_get_user.return_value = {'networkVolumes':[]}
25+
26+
result = self.runner.invoke(new_project_wizard)
27+
28+
self.assertEqual(result.exit_code, 1)
29+
self.assertIn("You do not have any network volumes.", result.output)
1930

2031
def test_new_project_wizard_success(self):
2132
'''

0 commit comments

Comments
 (0)