Skip to content

Commit 8b82f54

Browse files
committed
Added unit test for cli
1 parent 03b735c commit 8b82f54

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/unit/test_cli.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""Tests for the command line interface."""
2+
3+
from typer.testing import CliRunner
4+
5+
from helm_values_manager.cli import app
6+
7+
runner = CliRunner()
8+
9+
10+
def test_main_no_command():
11+
"""Test main function without any subcommand."""
12+
result = runner.invoke(app)
13+
assert result.exit_code == 0
14+
assert "Usage: helm values-manager" in result.stdout
15+
16+
17+
def test_init_command():
18+
"""Test init command."""
19+
result = runner.invoke(app, ["init", "--release", "test-release"])
20+
assert result.exit_code == 0
21+
assert "Initializing values manager" in result.stdout
22+
assert "test-release" in result.stdout

0 commit comments

Comments
 (0)