Skip to content

Commit 6a69185

Browse files
committed
Format
1 parent 3522da6 commit 6a69185

4 files changed

Lines changed: 17 additions & 13 deletions

File tree

src/fastapi_cloud_cli/commands/deploy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ def _create_environment_variables(app_id: str, env_vars: Dict[str, str]) -> None
235235
name: {"value": value, "is_secret": False}
236236
for name, value in env_vars.items()
237237
}
238-
response = client.post(f"/apps/{app_id}/environment-variables/batch", json=payload)
238+
response = client.post(
239+
f"/apps/{app_id}/environment-variables/batch", json=payload
240+
)
239241
response.raise_for_status()
240242

241243

@@ -259,6 +261,7 @@ def _stream_build_logs(deployment_id: str) -> Generator[str, None, None]:
259261
"💥 Oops! We've angered the Python God. Sacrificing a rubber duck to appease it.",
260262
"🧙 Sprinkling magic deployment dust. Abracadabra!",
261263
"👀 Hoping that @tiangolo doesn't find out about this deployment.",
264+
"⚡ Great Scott! This deployment needs more gigawatts!",
262265
"🍪 Cookie monster detected on server. Deploying anti-cookie shields.",
263266
]
264267

src/fastapi_cloud_cli/commands/env.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ def _delete_environment_variable(app_id: str, name: str) -> bool:
4444
return True
4545

4646

47-
def _set_environment_variable(app_id: str, name: str, value: str, is_secret: bool = False) -> None:
47+
def _set_environment_variable(
48+
app_id: str, name: str, value: str, is_secret: bool = False
49+
) -> None:
4850
with APIClient() as client:
4951
response = client.post(
5052
f"/apps/{app_id}/environment-variables/",

tests/test_cli_deploy.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,11 @@ def test_creates_environment_variables_during_app_setup(
763763
)
764764

765765
env_vars_request = respx_mock.post(
766-
f"/apps/{app_data['id']}/environment-variables/batch", json={"API_KEY": {"value": "fakesecret", "is_secret": False}, "TEST_ENV": {"value": "fakesecret123", "is_secret": False}}
766+
f"/apps/{app_data['id']}/environment-variables/batch",
767+
json={
768+
"API_KEY": {"value": "fakesecret", "is_secret": False},
769+
"TEST_ENV": {"value": "fakesecret123", "is_secret": False},
770+
},
767771
).mock(return_value=Response(200))
768772

769773
with changing_dir(tmp_path), patch(
@@ -809,7 +813,8 @@ def test_rejects_invalid_environment_variable_names(
809813
)
810814

811815
env_vars_request = respx_mock.post(
812-
f"/apps/{app_data['id']}/environment-variables/batch", json={"VALID_KEY": {"value": "value123", "is_secret": False}}
816+
f"/apps/{app_data['id']}/environment-variables/batch",
817+
json={"VALID_KEY": {"value": "value123", "is_secret": False}},
813818
).mock(return_value=Response(200))
814819

815820
with changing_dir(tmp_path), patch(

tests/test_env_set.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ def test_shows_a_message_if_app_is_not_configured(logged_in_cli: None) -> None:
4747
def test_shows_a_message_if_something_is_wrong(
4848
logged_in_cli: None, respx_mock: respx.MockRouter, configured_app: Path
4949
) -> None:
50-
respx_mock.post("/apps/123/environment-variables/").mock(
51-
return_value=Response(500)
52-
)
50+
respx_mock.post("/apps/123/environment-variables/").mock(return_value=Response(500))
5351

5452
with changing_dir(configured_app):
5553
result = runner.invoke(app, ["env", "set", "SOME_VAR", "secret"])
@@ -65,9 +63,7 @@ def test_shows_a_message_if_something_is_wrong(
6563
def test_shows_message_when_it_sets(
6664
logged_in_cli: None, respx_mock: respx.MockRouter, configured_app: Path
6765
) -> None:
68-
respx_mock.post("/apps/123/environment-variables/").mock(
69-
return_value=Response(200)
70-
)
66+
respx_mock.post("/apps/123/environment-variables/").mock(return_value=Response(200))
7167

7268
with changing_dir(configured_app):
7369
result = runner.invoke(app, ["env", "set", "SOME_VAR", "secret"])
@@ -82,9 +78,7 @@ def test_asks_for_name_and_value(
8278
) -> None:
8379
steps = [*"SOME_VAR", Keys.ENTER, *"secret", Keys.ENTER]
8480

85-
respx_mock.post("/apps/123/environment-variables/").mock(
86-
return_value=Response(200)
87-
)
81+
respx_mock.post("/apps/123/environment-variables/").mock(return_value=Response(200))
8882

8983
with changing_dir(configured_app), patch(
9084
"rich_toolkit.container.getchar", side_effect=steps

0 commit comments

Comments
 (0)