From de2fbc0a6848a2303b2911a62382914a5a58eda3 Mon Sep 17 00:00:00 2001 From: Alejandra Date: Thu, 11 Sep 2025 20:10:45 +0200 Subject: [PATCH 1/5] Update --- tests/test_cli_deploy.py | 30 +++++++++++++++--------------- tests/test_env_delete.py | 2 +- tests/test_env_set.py | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/test_cli_deploy.py b/tests/test_cli_deploy.py index d8f14d3..f48fd25 100644 --- a/tests/test_cli_deploy.py +++ b/tests/test_cli_deploy.py @@ -80,7 +80,7 @@ def test_shows_waitlist_form_when_not_logged_in( ).mock(return_value=Response(200)) with changing_dir(tmp_path), patch( - "rich_toolkit.menu.click.getchar" + "rich_toolkit.container.getchar" ) as mock_getchar: mock_getchar.side_effect = steps @@ -138,7 +138,7 @@ def test_shows_waitlist_form_when_not_logged_in_longer_flow( ).mock(return_value=Response(200)) with changing_dir(tmp_path), patch( - "rich_toolkit.menu.click.getchar" + "rich_toolkit.container.getchar" ) as mock_getchar: mock_getchar.side_effect = steps @@ -153,7 +153,7 @@ 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.menu.click.getchar" + "rich_toolkit.container.getchar" ) as mock_getchar: mock_getchar.side_effect = steps @@ -171,7 +171,7 @@ def test_shows_error_when_trying_to_get_teams( respx_mock.get("/teams/").mock(return_value=Response(500)) - with changing_dir(tmp_path), patch("click.getchar") as mock_getchar: + with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -189,7 +189,7 @@ def test_handles_invalid_auth( respx_mock.get("/teams/").mock(return_value=Response(401)) - with changing_dir(tmp_path), patch("click.getchar") as mock_getchar: + with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -215,7 +215,7 @@ def test_shows_teams( ) ) - with changing_dir(tmp_path), patch("click.getchar") as mock_getchar: + with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -239,7 +239,7 @@ def test_asks_for_app_name_after_team( ) ) - with changing_dir(tmp_path), patch("click.getchar") as mock_getchar: + with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -268,7 +268,7 @@ def test_creates_app_on_backend( return_value=Response(201, json=_get_random_app(team_id=team["id"])) ) - with changing_dir(tmp_path), patch("click.getchar") as mock_getchar: + with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -294,7 +294,7 @@ def test_uses_existing_app( return_value=Response(200, json={"data": [app_data]}) ) - with changing_dir(tmp_path), patch("click.getchar") as mock_getchar: + with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -367,7 +367,7 @@ def test_exits_successfully_when_deployment_is_done( ) ) - with changing_dir(tmp_path), patch("click.getchar") as mock_getchar: + with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -615,7 +615,7 @@ def _deploy_without_waiting(respx_mock: respx.MockRouter, tmp_path: Path) -> Res return_value=Response(200) ) - with changing_dir(tmp_path), patch("click.getchar") as mock_getchar: + with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: mock_getchar.side_effect = steps return runner.invoke(app, ["deploy", "--no-wait"]) @@ -687,7 +687,7 @@ def test_creates_environment_variables_during_app_setup( f"/apps/{app_data['id']}/environment-variables/", json={"API_KEY": "secret123"} ).mock(return_value=Response(200)) - with changing_dir(tmp_path), patch("click.getchar") as mock_getchar: + with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -731,7 +731,7 @@ def test_rejects_invalid_environment_variable_names( f"/apps/{app_data['id']}/environment-variables/", json={"VALID_KEY": "value123"} ).mock(return_value=Response(200)) - with changing_dir(tmp_path), patch("click.getchar") as mock_getchar: + with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -754,7 +754,7 @@ def test_shows_error_for_invalid_waitlist_form_data( ] with changing_dir(tmp_path), patch( - "rich_toolkit.menu.click.getchar" + "rich_toolkit.container.getchar" ) as mock_getchar, patch("rich_toolkit.form.Form.run") as mock_form_run: mock_getchar.side_effect = steps # Simulate form returning data with invalid email field to trigger ValidationError @@ -789,7 +789,7 @@ def test_shows_no_apps_found_message_when_team_has_no_apps( return_value=Response(200, json={"data": []}) ) - with changing_dir(tmp_path), patch("click.getchar") as mock_getchar: + with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) diff --git a/tests/test_env_delete.py b/tests/test_env_delete.py index 1b9f9c5..fee1062 100644 --- a/tests/test_env_delete.py +++ b/tests/test_env_delete.py @@ -122,7 +122,7 @@ def test_shows_selector_for_environment_variables( return_value=Response(204) ) - with changing_dir(configured_app), patch("click.getchar", side_effect=steps): + with changing_dir(configured_app), patch("rich_toolkit.container.getchar", side_effect=steps): result = runner.invoke(app, ["env", "delete"]) assert result.exit_code == 0 diff --git a/tests/test_env_set.py b/tests/test_env_set.py index c4182da..ff427d4 100644 --- a/tests/test_env_set.py +++ b/tests/test_env_set.py @@ -86,7 +86,7 @@ def test_asks_for_name_and_value( return_value=Response(200) ) - with changing_dir(configured_app), patch("click.getchar", side_effect=steps): + with changing_dir(configured_app), patch("rich_toolkit.container.getchar", side_effect=steps): result = runner.invoke(app, ["env", "set"]) assert result.exit_code == 0 From 6208163af17710947940393782ebee683004ed68 Mon Sep 17 00:00:00 2001 From: Alejandra Date: Thu, 11 Sep 2025 20:15:45 +0200 Subject: [PATCH 2/5] Update --- tests/test_cli_deploy.py | 44 ++++++++++++++++++++++++++++++---------- tests/test_env_delete.py | 4 +++- tests/test_env_set.py | 4 +++- 3 files changed, 39 insertions(+), 13 deletions(-) diff --git a/tests/test_cli_deploy.py b/tests/test_cli_deploy.py index f48fd25..4a09ecb 100644 --- a/tests/test_cli_deploy.py +++ b/tests/test_cli_deploy.py @@ -171,7 +171,9 @@ def test_shows_error_when_trying_to_get_teams( respx_mock.get("/teams/").mock(return_value=Response(500)) - with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: + with changing_dir(tmp_path), patch( + "rich_toolkit.container.getchar" + ) as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -189,7 +191,9 @@ def test_handles_invalid_auth( respx_mock.get("/teams/").mock(return_value=Response(401)) - with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: + with changing_dir(tmp_path), patch( + "rich_toolkit.container.getchar" + ) as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -215,7 +219,9 @@ def test_shows_teams( ) ) - with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: + with changing_dir(tmp_path), patch( + "rich_toolkit.container.getchar" + ) as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -239,7 +245,9 @@ def test_asks_for_app_name_after_team( ) ) - with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: + with changing_dir(tmp_path), patch( + "rich_toolkit.container.getchar" + ) as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -268,7 +276,9 @@ def test_creates_app_on_backend( return_value=Response(201, json=_get_random_app(team_id=team["id"])) ) - with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: + with changing_dir(tmp_path), patch( + "rich_toolkit.container.getchar" + ) as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -294,7 +304,9 @@ def test_uses_existing_app( return_value=Response(200, json={"data": [app_data]}) ) - with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: + with changing_dir(tmp_path), patch( + "rich_toolkit.container.getchar" + ) as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -367,7 +379,9 @@ def test_exits_successfully_when_deployment_is_done( ) ) - with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: + with changing_dir(tmp_path), patch( + "rich_toolkit.container.getchar" + ) as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -615,7 +629,9 @@ def _deploy_without_waiting(respx_mock: respx.MockRouter, tmp_path: Path) -> Res return_value=Response(200) ) - with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: + with changing_dir(tmp_path), patch( + "rich_toolkit.container.getchar" + ) as mock_getchar: mock_getchar.side_effect = steps return runner.invoke(app, ["deploy", "--no-wait"]) @@ -687,7 +703,9 @@ def test_creates_environment_variables_during_app_setup( f"/apps/{app_data['id']}/environment-variables/", json={"API_KEY": "secret123"} ).mock(return_value=Response(200)) - with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: + with changing_dir(tmp_path), patch( + "rich_toolkit.container.getchar" + ) as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -731,7 +749,9 @@ def test_rejects_invalid_environment_variable_names( f"/apps/{app_data['id']}/environment-variables/", json={"VALID_KEY": "value123"} ).mock(return_value=Response(200)) - with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: + with changing_dir(tmp_path), patch( + "rich_toolkit.container.getchar" + ) as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) @@ -789,7 +809,9 @@ def test_shows_no_apps_found_message_when_team_has_no_apps( return_value=Response(200, json={"data": []}) ) - with changing_dir(tmp_path), patch("rich_toolkit.container.getchar") as mock_getchar: + with changing_dir(tmp_path), patch( + "rich_toolkit.container.getchar" + ) as mock_getchar: mock_getchar.side_effect = steps result = runner.invoke(app, ["deploy"]) diff --git a/tests/test_env_delete.py b/tests/test_env_delete.py index fee1062..e5203aa 100644 --- a/tests/test_env_delete.py +++ b/tests/test_env_delete.py @@ -122,7 +122,9 @@ def test_shows_selector_for_environment_variables( return_value=Response(204) ) - with changing_dir(configured_app), patch("rich_toolkit.container.getchar", side_effect=steps): + with changing_dir(configured_app), patch( + "rich_toolkit.container.getchar", side_effect=steps + ): result = runner.invoke(app, ["env", "delete"]) assert result.exit_code == 0 diff --git a/tests/test_env_set.py b/tests/test_env_set.py index ff427d4..85dc5d4 100644 --- a/tests/test_env_set.py +++ b/tests/test_env_set.py @@ -86,7 +86,9 @@ def test_asks_for_name_and_value( return_value=Response(200) ) - with changing_dir(configured_app), patch("rich_toolkit.container.getchar", side_effect=steps): + with changing_dir(configured_app), patch( + "rich_toolkit.container.getchar", side_effect=steps + ): result = runner.invoke(app, ["env", "set"]) assert result.exit_code == 0 From d3607268b93f10828b35c15ce05948e6a5c0d83e Mon Sep 17 00:00:00 2001 From: Alejandra Date: Thu, 11 Sep 2025 20:19:56 +0200 Subject: [PATCH 3/5] Trigger CI --- requirements-tests.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-tests.txt b/requirements-tests.txt index fadb2db..12fd1d8 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -5,3 +5,4 @@ coverage[toml] >=6.2,<8.0 mypy ==1.14.1 ruff ==0.12.0 respx ==0.22.0 +# trigger CI \ No newline at end of file From 5db9175f7e7141311338525e193ac3fca2393cd6 Mon Sep 17 00:00:00 2001 From: Alejandra Date: Thu, 11 Sep 2025 20:23:22 +0200 Subject: [PATCH 4/5] Update --- requirements-tests.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 12fd1d8..118b64d 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -4,5 +4,4 @@ pytest >=4.4.0,<9.0.0 coverage[toml] >=6.2,<8.0 mypy ==1.14.1 ruff ==0.12.0 -respx ==0.22.0 -# trigger CI \ No newline at end of file +respx ==0.22.0 \ No newline at end of file From f0dc306a8b90863340e7cbbad09aee0449eda013 Mon Sep 17 00:00:00 2001 From: Alejandra Date: Thu, 11 Sep 2025 20:24:20 +0200 Subject: [PATCH 5/5] Format --- requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 118b64d..fadb2db 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -4,4 +4,4 @@ pytest >=4.4.0,<9.0.0 coverage[toml] >=6.2,<8.0 mypy ==1.14.1 ruff ==0.12.0 -respx ==0.22.0 \ No newline at end of file +respx ==0.22.0