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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
"uvicorn[standard] >= 0.17.6",
"rignore >= 0.5.1",
"httpx >= 0.27.0",
"rich-toolkit>=0.20.5",
"rich-toolkit>=0.20.6",
"pydantic[email] >= 2.7.4; python_version < '3.13'",
"pydantic[email] >= 2.8.0; python_version == '3.13'",
"pydantic[email] >= 2.12.0; python_version >= '3.14'",
Expand Down
12 changes: 7 additions & 5 deletions tests/domains/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,9 @@ def test_domains_remove_warns_and_confirms(
return_value=Response(200, json={"message": "Custom domain deleted"})
)

with patch("rich_toolkit.container.getchar", side_effect=[Keys.ENTER]):
with patch(
"rich_toolkit.container.getchar", side_effect=[Keys.RIGHT_ARROW, Keys.ENTER]
):
result = runner.invoke(
app,
["domains", "remove", domain["name"], "--app-id", APP_ID],
Expand All @@ -967,6 +969,9 @@ def test_domains_remove_warns_and_confirms(
⚠️ FastAPI Cloud resources for api.example.com will be removed. DNS records at
your provider will not be changed.
Remove api.example.com?
○ Yes ● No
Remove api.example.com?
● Yes ○ No
Expand Down Expand Up @@ -1023,7 +1028,7 @@ def test_domains_remove_can_be_cancelled(

with patch(
"rich_toolkit.container.getchar",
side_effect=[Keys.RIGHT_ARROW, Keys.ENTER],
side_effect=[Keys.ENTER],
):
result = runner.invoke(
app,
Expand All @@ -1037,9 +1042,6 @@ def test_domains_remove_can_be_cancelled(
⚠️ FastAPI Cloud resources for api.example.com will be removed. DNS records at
your provider will not be changed.
Remove api.example.com?
● Yes ○ No
Remove api.example.com?
○ Yes ● No
Expand Down
17 changes: 11 additions & 6 deletions tests/integrations/resources/test_disconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def test_disconnect_resource_allows_interactive_selection(
changing_dir(tmp_path),
patch(
"rich_toolkit.container.getchar",
side_effect=[Keys.ENTER, Keys.ENTER],
side_effect=[Keys.ENTER, Keys.RIGHT_ARROW, Keys.ENTER],
),
):
result = runner.invoke(app, ["integrations", "resources", "disconnect"])
Expand All @@ -238,6 +238,9 @@ def test_disconnect_resource_allows_interactive_selection(
💡 The managed environment variables DATABASE_URL, DATABASE_PASSWORD will be
removed from the app. The Neon resource itself will not be deleted.
Disconnect production?
○ Yes ● No
Disconnect production?
● Yes ○ No
Expand All @@ -264,7 +267,9 @@ def test_disconnect_resource_prompts_for_confirmation_when_id_is_provided(
return_value=Response(204)
)

with patch("rich_toolkit.container.getchar", side_effect=[Keys.ENTER]):
with patch(
"rich_toolkit.container.getchar", side_effect=[Keys.RIGHT_ARROW, Keys.ENTER]
):
result = runner.invoke(
app,
[
Expand All @@ -284,6 +289,9 @@ def test_disconnect_resource_prompts_for_confirmation_when_id_is_provided(
💡 Managed environment variables will be removed from the app. The Neon
resource itself will not be deleted.
Disconnect production?
○ Yes ● No
Disconnect production?
● Yes ○ No
Expand All @@ -304,7 +312,7 @@ def test_disconnect_resource_can_be_cancelled(

with patch(
"rich_toolkit.container.getchar",
side_effect=[Keys.RIGHT_ARROW, Keys.ENTER],
side_effect=[Keys.ENTER],
):
result = runner.invoke(
app,
Expand All @@ -325,9 +333,6 @@ def test_disconnect_resource_can_be_cancelled(
💡 The managed environment variables DATABASE_URL, DATABASE_PASSWORD will be
removed from the app. The Neon resource itself will not be deleted.
Disconnect production?
● Yes ○ No
Disconnect production?
○ Yes ● No
Expand Down
9 changes: 6 additions & 3 deletions tests/test_cli_setup_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,12 @@ def test_overwrites_existing_workflow_when_confirmed(
patch("fastapi_cloud_cli.commands.setup_ci._set_github_secret"),
patch("rich_toolkit.container.getchar") as mock_getchar,
):
mock_getchar.side_effect = [Keys.ENTER, Keys.ENTER, Keys.ENTER]
mock_getchar.side_effect = [
Keys.ENTER,
Keys.ENTER,
Keys.RIGHT_ARROW,
Keys.ENTER,
]
result = runner.invoke(app, ["setup-ci"])

assert result.exit_code == 0
Expand Down Expand Up @@ -768,7 +773,6 @@ def test_skips_writing_workflow_when_declined(
mock_getchar.side_effect = [
Keys.ENTER,
Keys.ENTER,
Keys.RIGHT_ARROW,
Keys.ENTER,
Keys.ENTER,
]
Expand Down Expand Up @@ -811,7 +815,6 @@ def test_renames_workflow_when_declined_and_new_name_given(
mock_getchar.side_effect = [
Keys.ENTER,
Keys.ENTER,
Keys.RIGHT_ARROW,
Keys.ENTER,
*"ci-deploy.yml",
Keys.ENTER,
Expand Down
12 changes: 7 additions & 5 deletions tests/test_env_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,17 @@ def test_shows_message_when_it_deletes(

with (
changing_dir(configured_app),
patch("rich_toolkit.container.getchar", side_effect=[Keys.ENTER]),
patch(
"rich_toolkit.container.getchar", side_effect=[Keys.RIGHT_ARROW, Keys.ENTER]
),
):
result = runner.invoke(app, ["env", "delete", "SOME_VAR"])

assert result.exit_code == 0
assert result.output == snapshot("""\
Delete SOME_VAR?
○ Yes ● No
Delete SOME_VAR?
● Yes ○ No
Expand Down Expand Up @@ -360,16 +365,13 @@ def test_shows_message_when_deletion_is_cancelled(
changing_dir(configured_app),
patch(
"rich_toolkit.container.getchar",
side_effect=[Keys.RIGHT_ARROW, Keys.ENTER],
side_effect=[Keys.ENTER],
),
):
result = runner.invoke(app, ["env", "delete", "SOME_VAR"])

assert result.exit_code == 0
assert result.output == snapshot("""\
Delete SOME_VAR?
● Yes ○ No
Delete SOME_VAR?
○ Yes ● No
Expand Down
10 changes: 5 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading