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
1 change: 1 addition & 0 deletions src/fastapi_cloud_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
cloud_app = typer.Typer(
rich_markup_mode="rich",
help="Manage [bold]FastAPI[/bold] Cloud deployments. 🚀",
no_args_is_help=True,
)

# TODO: use the app structure
Expand Down
20 changes: 20 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
import subprocess
import sys

from typer.testing import CliRunner

from fastapi_cloud_cli.cli import app

runner = CliRunner()


def test_shows_help() -> None:
result = runner.invoke(app, ["cloud", "--help"])

assert result.exit_code == 0
assert "Usage:" in result.output


def test_shows_help_without_args() -> None:
result = runner.invoke(app, ["cloud"])

assert result.exit_code == 2
assert "Usage:" in result.output


def test_script() -> None:
result = subprocess.run(
Expand Down
Loading