Skip to content

Commit

Permalink
🎨 Remove deprecated app arg from httpx.AsyncClient
Browse files Browse the repository at this point in the history
  • Loading branch information
ff137 committed Nov 30, 2024
1 parent 1c8b278 commit 4409674
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions app/tests/util/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Dict, Optional
from typing import Any, Dict

from aries_cloudcontroller import AcaPyClient
from httpx import AsyncHTTPTransport
Expand All @@ -16,10 +16,9 @@
)


def get_common_settings(api_key: str, app: Optional[Any] = None) -> Dict[str, Any]:
def get_common_settings(api_key: str) -> Dict[str, Any]:
return {
"timeout": TEST_CLIENT_TIMEOUT,
"app": app,
"headers": {
"x-api-key": api_key,
"content-type": "application/json",
Expand All @@ -29,8 +28,8 @@ def get_common_settings(api_key: str, app: Optional[Any] = None) -> Dict[str, An


# Governance Clients
def get_governance_client(*, app: Optional[Any] = None) -> RichAsyncClient:
settings = get_common_settings(f"governance.{GOVERNANCE_ACAPY_API_KEY}", app)
def get_governance_client() -> RichAsyncClient:
settings = get_common_settings(f"governance.{GOVERNANCE_ACAPY_API_KEY}")
return RichAsyncClient(
base_url=GOVERNANCE_FASTAPI_ENDPOINT, name="Governance", **settings
)
Expand All @@ -41,8 +40,8 @@ def get_governance_acapy_client() -> AcaPyClient:


# Tenant Admin Clients
def get_tenant_admin_client(*, app: Optional[Any] = None) -> RichAsyncClient:
settings = get_common_settings(f"tenant-admin.{TENANT_ACAPY_API_KEY}", app)
def get_tenant_admin_client() -> RichAsyncClient:
settings = get_common_settings(f"tenant-admin.{TENANT_ACAPY_API_KEY}")
return RichAsyncClient(
base_url=TENANT_ADMIN_FASTAPI_ENDPOINT, name="Tenant Admin", **settings
)
Expand All @@ -53,10 +52,8 @@ def get_tenant_admin_acapy_client() -> AcaPyClient:


# Tenant Clients
def get_tenant_client(
*, token: str, app: Optional[Any] = None, name: str = ""
) -> RichAsyncClient:
settings = get_common_settings(token, app)
def get_tenant_client(*, token: str, name: str = "") -> RichAsyncClient:
settings = get_common_settings(token)
return RichAsyncClient(
base_url=TENANT_FASTAPI_ENDPOINT, name=f"Tenant {name}", **settings
)
Expand Down

0 comments on commit 4409674

Please sign in to comment.