1111from typer .testing import CliRunner
1212
1313from fastapi_cloud_cli .cli import app
14- from fastapi_cloud_cli .config import settings
14+ from fastapi_cloud_cli .config import Settings
1515from tests .conftest import ConfiguredApp
1616from tests .utils import Keys , changing_dir
1717
@@ -58,7 +58,7 @@ def _get_random_deployment(
5858 }
5959
6060
61- @pytest .mark .respx (base_url = settings .base_api_url )
61+ @pytest .mark .respx (base_url = Settings .base_api_url )
6262def test_shows_waitlist_form_when_not_logged_in (
6363 logged_out_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
6464) -> None :
@@ -90,7 +90,7 @@ def test_shows_waitlist_form_when_not_logged_in(
9090 assert "Let's go! Thanks for your interest in FastAPI Cloud! 🚀" in result .output
9191
9292
93- @pytest .mark .respx (base_url = settings .base_api_url )
93+ @pytest .mark .respx (base_url = Settings .base_api_url )
9494def test_shows_waitlist_form_when_not_logged_in_longer_flow (
9595 logged_out_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
9696) -> None :
@@ -162,7 +162,7 @@ def test_asks_to_setup_the_app(logged_in_cli: None, tmp_path: Path) -> None:
162162 assert "Setup and deploy" in result .output
163163
164164
165- @pytest .mark .respx (base_url = settings .base_api_url )
165+ @pytest .mark .respx (base_url = Settings .base_api_url )
166166def test_shows_error_when_trying_to_get_teams (
167167 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
168168) -> None :
@@ -180,7 +180,7 @@ def test_shows_error_when_trying_to_get_teams(
180180 assert "Error fetching teams. Please try again later" in result .output
181181
182182
183- @pytest .mark .respx (base_url = settings .base_api_url )
183+ @pytest .mark .respx (base_url = Settings .base_api_url )
184184def test_handles_invalid_auth (
185185 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
186186) -> None :
@@ -198,7 +198,7 @@ def test_handles_invalid_auth(
198198 assert "The specified token is not valid" in result .output
199199
200200
201- @pytest .mark .respx (base_url = settings .base_api_url )
201+ @pytest .mark .respx (base_url = Settings .base_api_url )
202202def test_shows_teams (
203203 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
204204) -> None :
@@ -225,7 +225,7 @@ def test_shows_teams(
225225 assert team_2 ["name" ] in result .output
226226
227227
228- @pytest .mark .respx (base_url = settings .base_api_url )
228+ @pytest .mark .respx (base_url = Settings .base_api_url )
229229def test_asks_for_app_name_after_team (
230230 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
231231) -> None :
@@ -248,7 +248,7 @@ def test_asks_for_app_name_after_team(
248248 assert "What's your app name?" in result .output
249249
250250
251- @pytest .mark .respx (base_url = settings .base_api_url )
251+ @pytest .mark .respx (base_url = Settings .base_api_url )
252252def test_creates_app_on_backend (
253253 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
254254) -> None :
@@ -277,7 +277,7 @@ def test_creates_app_on_backend(
277277 assert "App created successfully" in result .output
278278
279279
280- @pytest .mark .respx (base_url = settings .base_api_url )
280+ @pytest .mark .respx (base_url = Settings .base_api_url )
281281def test_uses_existing_app (
282282 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
283283) -> None :
@@ -304,7 +304,7 @@ def test_uses_existing_app(
304304 assert app_data ["slug" ] in result .output
305305
306306
307- @pytest .mark .respx (base_url = settings .base_api_url )
307+ @pytest .mark .respx (base_url = Settings .base_api_url )
308308def test_exits_successfully_when_deployment_is_done (
309309 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
310310) -> None :
@@ -376,7 +376,7 @@ def test_exits_successfully_when_deployment_is_done(
376376 # TODO: show a message when the deployment is done (based on the status)
377377
378378
379- @pytest .mark .respx (base_url = settings .base_api_url )
379+ @pytest .mark .respx (base_url = Settings .base_api_url )
380380def test_exits_successfully_when_deployment_is_done_when_app_is_configured (
381381 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
382382) -> None :
@@ -438,7 +438,7 @@ def test_exits_successfully_when_deployment_is_done_when_app_is_configured(
438438 assert deployment_data ["url" ] in result .output
439439
440440
441- @pytest .mark .respx (base_url = settings .base_api_url )
441+ @pytest .mark .respx (base_url = Settings .base_api_url )
442442def test_exits_with_error_when_deployment_fails_to_build (
443443 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
444444) -> None :
@@ -493,7 +493,7 @@ def test_exits_with_error_when_deployment_fails_to_build(
493493 assert deployment_data ["dashboard_url" ] in result .output
494494
495495
496- @pytest .mark .respx (base_url = settings .base_api_url )
496+ @pytest .mark .respx (base_url = Settings .base_api_url )
497497def test_shows_error_when_deployment_build_fails (
498498 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
499499) -> None :
@@ -547,7 +547,7 @@ def test_shows_error_when_deployment_build_fails(
547547 assert result .exit_code == 1
548548
549549
550- @pytest .mark .respx (base_url = settings .base_api_url )
550+ @pytest .mark .respx (base_url = Settings .base_api_url )
551551def test_shows_error_when_app_does_not_exist (
552552 logged_in_cli : None , configured_app : ConfiguredApp , respx_mock : respx .MockRouter
553553) -> None :
@@ -620,7 +620,7 @@ def _deploy_without_waiting(respx_mock: respx.MockRouter, tmp_path: Path) -> Res
620620 return runner .invoke (app , ["deploy" , "--no-wait" ])
621621
622622
623- @pytest .mark .respx (base_url = settings .base_api_url )
623+ @pytest .mark .respx (base_url = Settings .base_api_url )
624624def test_can_skip_waiting (
625625 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
626626) -> None :
@@ -631,7 +631,7 @@ def test_can_skip_waiting(
631631 assert "Check the status of your deployment at" in result .output
632632
633633
634- @pytest .mark .respx (base_url = settings .base_api_url )
634+ @pytest .mark .respx (base_url = Settings .base_api_url )
635635def test_creates_config_folder_and_creates_git_ignore (
636636 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
637637) -> None :
@@ -642,7 +642,7 @@ def test_creates_config_folder_and_creates_git_ignore(
642642 assert (tmp_path / ".fastapicloud" / ".gitignore" ).read_text () == "*"
643643
644644
645- @pytest .mark .respx (base_url = settings .base_api_url )
645+ @pytest .mark .respx (base_url = Settings .base_api_url )
646646def test_does_not_duplicate_entry_in_git_ignore (
647647 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
648648) -> None :
@@ -654,7 +654,7 @@ def test_does_not_duplicate_entry_in_git_ignore(
654654 assert git_ignore_path .read_text () == ".fastapicloud\n "
655655
656656
657- @pytest .mark .respx (base_url = settings .base_api_url )
657+ @pytest .mark .respx (base_url = Settings .base_api_url )
658658def test_creates_environment_variables_during_app_setup (
659659 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
660660) -> None :
@@ -696,7 +696,7 @@ def test_creates_environment_variables_during_app_setup(
696696 assert "Environment variables set up successfully!" in result .output
697697
698698
699- @pytest .mark .respx (base_url = settings .base_api_url )
699+ @pytest .mark .respx (base_url = Settings .base_api_url )
700700def test_rejects_invalid_environment_variable_names (
701701 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
702702) -> None :
@@ -741,7 +741,7 @@ def test_rejects_invalid_environment_variable_names(
741741 assert "Environment variables set up successfully!" in result .output
742742
743743
744- @pytest .mark .respx (base_url = settings .base_api_url )
744+ @pytest .mark .respx (base_url = Settings .base_api_url )
745745def test_shows_error_for_invalid_waitlist_form_data (
746746 logged_out_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
747747) -> None :
@@ -768,7 +768,7 @@ def test_shows_error_for_invalid_waitlist_form_data(
768768 assert "Invalid form data. Please try again." in result .output
769769
770770
771- @pytest .mark .respx (base_url = settings .base_api_url )
771+ @pytest .mark .respx (base_url = Settings .base_api_url )
772772def test_shows_no_apps_found_message_when_team_has_no_apps (
773773 logged_in_cli : None , tmp_path : Path , respx_mock : respx .MockRouter
774774) -> None :
0 commit comments