Skip to content

Commit 2ab39c0

Browse files
committed
PTHMINT-108: Make E2E base URL dynamic and stabilize URL tests
1 parent 6e638c7 commit 2ab39c0

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

tests/multisafepay/unit/client/test_unit_client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,14 @@ def test_rejects_custom_base_url_without_netloc(
265265
)
266266

267267

268-
def test_allows_missing_api_key_with_credential_resolver():
268+
def test_allows_missing_api_key_with_credential_resolver(
269+
monkeypatch: pytest.MonkeyPatch,
270+
):
269271
"""Test that resolver-only mode works without passing api_key."""
272+
monkeypatch.delenv("MSP_SDK_BUILD_PROFILE", raising=False)
273+
monkeypatch.delenv("MSP_SDK_CUSTOM_BASE_URL", raising=False)
274+
monkeypatch.delenv("MSP_SDK_ALLOW_CUSTOM_BASE_URL", raising=False)
275+
270276
resolver = ScopedCredentialResolver(default_api_key="resolver_api_key")
271277

272278
client = Client(

tests/multisafepay/unit/test_unit_sdk.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,14 @@ def test_sdk_blocks_custom_base_url_in_release(
101101
)
102102

103103

104-
def test_sdk_allows_resolver_only_initialization() -> None:
104+
def test_sdk_allows_resolver_only_initialization(
105+
monkeypatch: pytest.MonkeyPatch,
106+
) -> None:
105107
"""Allow constructing SDK without api_key when resolver is provided."""
108+
monkeypatch.delenv("MSP_SDK_BUILD_PROFILE", raising=False)
109+
monkeypatch.delenv("MSP_SDK_CUSTOM_BASE_URL", raising=False)
110+
monkeypatch.delenv("MSP_SDK_ALLOW_CUSTOM_BASE_URL", raising=False)
111+
106112
resolver = ScopedCredentialResolver(default_api_key="resolver_api_key")
107113

108114
sdk = Sdk(

0 commit comments

Comments
 (0)