Skip to content

Commit d3351cc

Browse files
authored
🔥 Remove path confirmation on first deployment (#123)
1 parent 1d97652 commit d3351cc

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

‎src/fastapi_cloud_cli/commands/deploy.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,7 @@ def _get_apps(team_id: str) -> List[AppResponse]:
260260

261261

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

266265
toolkit.print_line()
267266

‎tests/test_cli_deploy.py‎

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -211,20 +211,6 @@ def test_shows_waitlist_form_when_not_logged_in_longer_flow(
211211
assert "Let's go! Thanks for your interest in FastAPI Cloud! 🚀" in result.output
212212

213213

214-
def test_asks_to_setup_the_app(logged_in_cli: None, tmp_path: Path) -> None:
215-
steps = [Keys.RIGHT_ARROW, Keys.ENTER]
216-
217-
with changing_dir(tmp_path), patch(
218-
"rich_toolkit.container.getchar"
219-
) as mock_getchar:
220-
mock_getchar.side_effect = steps
221-
222-
result = runner.invoke(app, ["deploy"])
223-
224-
assert result.exit_code == 0
225-
assert "Setup and deploy" in result.output
226-
227-
228214
@pytest.mark.respx(base_url=settings.base_api_url)
229215
def test_shows_error_when_trying_to_get_teams(
230216
logged_in_cli: None, tmp_path: Path, respx_mock: respx.MockRouter
@@ -323,7 +309,7 @@ def test_asks_for_app_name_after_team(
323309
def test_creates_app_on_backend(
324310
logged_in_cli: None, tmp_path: Path, respx_mock: respx.MockRouter
325311
) -> None:
326-
steps = [Keys.ENTER, Keys.ENTER, Keys.ENTER, *"demo", Keys.ENTER]
312+
steps = [Keys.ENTER, Keys.ENTER, *"demo", Keys.ENTER]
327313

328314
team = _get_random_team()
329315

@@ -354,7 +340,7 @@ def test_creates_app_on_backend(
354340
def test_uses_existing_app(
355341
logged_in_cli: None, tmp_path: Path, respx_mock: respx.MockRouter
356342
) -> None:
357-
steps = [Keys.ENTER, Keys.ENTER, Keys.RIGHT_ARROW, Keys.ENTER, *"demo", Keys.ENTER]
343+
steps = [Keys.ENTER, Keys.RIGHT_ARROW, Keys.ENTER, *"demo", Keys.ENTER]
358344

359345
team = _get_random_team()
360346

@@ -384,7 +370,6 @@ def test_exits_successfully_when_deployment_is_done(
384370
logged_in_cli: None, tmp_path: Path, respx_mock: respx.MockRouter
385371
) -> None:
386372
steps = [
387-
Keys.ENTER,
388373
Keys.ENTER,
389374
Keys.ENTER,
390375
*"demo",
@@ -634,7 +619,6 @@ def test_shows_error_when_app_does_not_exist(
634619

635620
def _deploy_without_waiting(respx_mock: respx.MockRouter, tmp_path: Path) -> Result:
636621
steps = [
637-
Keys.ENTER,
638622
Keys.ENTER,
639623
Keys.ENTER,
640624
*"demo",
@@ -759,7 +743,6 @@ def test_shows_no_apps_found_message_when_team_has_no_apps(
759743
logged_in_cli: None, tmp_path: Path, respx_mock: respx.MockRouter
760744
) -> None:
761745
steps = [
762-
Keys.ENTER, # Setup and deploy
763746
Keys.ENTER, # Select team
764747
Keys.RIGHT_ARROW, # Choose existing app (No)
765748
Keys.ENTER,

0 commit comments

Comments
 (0)