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
3 changes: 1 addition & 2 deletions src/fastapi_cloud_cli/commands/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ def _get_apps(team_id: str) -> List[AppResponse]:


def _configure_app(toolkit: RichToolkit, path_to_deploy: Path) -> AppConfig:
if not toolkit.confirm(f"Setup and deploy [blue]{path_to_deploy}[/]?", tag="dir"):
raise typer.Exit(0)
toolkit.print(f"Setting up and deploying [blue]{path_to_deploy}[/blue]", tag="path")

toolkit.print_line()

Expand Down
21 changes: 2 additions & 19 deletions tests/test_cli_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,20 +211,6 @@ def test_shows_waitlist_form_when_not_logged_in_longer_flow(
assert "Let's go! Thanks for your interest in FastAPI Cloud! 🚀" in result.output


def test_asks_to_setup_the_app(logged_in_cli: None, tmp_path: Path) -> None:
steps = [Keys.RIGHT_ARROW, Keys.ENTER]

with changing_dir(tmp_path), patch(
"rich_toolkit.container.getchar"
) as mock_getchar:
mock_getchar.side_effect = steps

result = runner.invoke(app, ["deploy"])

assert result.exit_code == 0
assert "Setup and deploy" in result.output


@pytest.mark.respx(base_url=settings.base_api_url)
def test_shows_error_when_trying_to_get_teams(
logged_in_cli: None, tmp_path: Path, respx_mock: respx.MockRouter
Expand Down Expand Up @@ -323,7 +309,7 @@ def test_asks_for_app_name_after_team(
def test_creates_app_on_backend(
logged_in_cli: None, tmp_path: Path, respx_mock: respx.MockRouter
) -> None:
steps = [Keys.ENTER, Keys.ENTER, Keys.ENTER, *"demo", Keys.ENTER]
steps = [Keys.ENTER, Keys.ENTER, *"demo", Keys.ENTER]

team = _get_random_team()

Expand Down Expand Up @@ -354,7 +340,7 @@ def test_creates_app_on_backend(
def test_uses_existing_app(
logged_in_cli: None, tmp_path: Path, respx_mock: respx.MockRouter
) -> None:
steps = [Keys.ENTER, Keys.ENTER, Keys.RIGHT_ARROW, Keys.ENTER, *"demo", Keys.ENTER]
steps = [Keys.ENTER, Keys.RIGHT_ARROW, Keys.ENTER, *"demo", Keys.ENTER]

team = _get_random_team()

Expand Down Expand Up @@ -384,7 +370,6 @@ def test_exits_successfully_when_deployment_is_done(
logged_in_cli: None, tmp_path: Path, respx_mock: respx.MockRouter
) -> None:
steps = [
Keys.ENTER,
Keys.ENTER,
Keys.ENTER,
*"demo",
Expand Down Expand Up @@ -634,7 +619,6 @@ def test_shows_error_when_app_does_not_exist(

def _deploy_without_waiting(respx_mock: respx.MockRouter, tmp_path: Path) -> Result:
steps = [
Keys.ENTER,
Keys.ENTER,
Keys.ENTER,
*"demo",
Expand Down Expand Up @@ -759,7 +743,6 @@ def test_shows_no_apps_found_message_when_team_has_no_apps(
logged_in_cli: None, tmp_path: Path, respx_mock: respx.MockRouter
) -> None:
steps = [
Keys.ENTER, # Setup and deploy
Keys.ENTER, # Select team
Keys.RIGHT_ARROW, # Choose existing app (No)
Keys.ENTER,
Expand Down