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 @@ -50,7 +50,7 @@ dev = [
"prek>=0.2.24,<1.0.0",
"pytest>=7.0.0,<10.0.0",
"coverage[toml]>=7.2,<8.0",
"mypy==2.3.1",
"mypy==2.4.1",
"ruff>=0.15.16",
"respx==0.23.1",
"time-machine>=2.19.0",
Expand Down
6 changes: 1 addition & 5 deletions src/fastapi_cloud_cli/commands/integrations/resources/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
from fastapi_cloud_cli.api import APIClient
from fastapi_cloud_cli.commands._auth import UserCommand, get_user_command_context
from fastapi_cloud_cli.commands.integrations.resources._app import resources_app
from fastapi_cloud_cli.commands.integrations.resources.providers import (
PROVIDER_NAMES,
Provider,
)
from fastapi_cloud_cli.commands.integrations.resources.providers import PROVIDER_NAMES
from fastapi_cloud_cli.utils.apps import resolve_app_id_or_fail
from fastapi_cloud_cli.utils.cli import get_details_table
from fastapi_cloud_cli.utils.dates import format_last_updated
Expand Down Expand Up @@ -55,7 +52,6 @@ class ConnectedResourceAPIResponse(BaseModel):
class ConnectedResourceBase(BaseModel):
id: str
name: str
provider: Provider
console_url: str
environment_variables: list[str]
created_at: str
Expand Down
6 changes: 4 additions & 2 deletions tests/integrations/resources/test_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,19 @@ def test_gets_resource_json_returns_not_logged_in_when_logged_out(


@pytest.mark.respx
@pytest.mark.parametrize("provider", ["neon", "redis", "supabase"])
def test_gets_database_resource_as_json_with_explicit_app_overriding_linked_app(
logged_in_cli: None,
respx_mock: respx.MockRouter,
tmp_path: Path,
provider: DatabaseProvider,
) -> None:
write_app_config(
tmp_path,
AppConfig(app_id=LINKED_APP_ID, team_id=TEAM_ID),
)
respx_mock.get(f"/apps/{APP_ID}/connected-resources/{RESOURCE_ID}").mock(
return_value=Response(200, json=_database_resource())
return_value=Response(200, json=_database_resource(provider=provider))
)

with changing_dir(tmp_path):
Expand All @@ -141,7 +143,7 @@ def test_gets_database_resource_as_json_with_explicit_app_overriding_linked_app(
"resource": {
"id": RESOURCE_ID,
"name": "production",
"provider": "neon",
"provider": provider,
"console_url": CONSOLE_URL,
"environment_variables": ["DATABASE_URL", "DATABASE_PASSWORD"],
"created_at": CREATED_AT,
Expand Down
Loading
Loading