Context
RecurringTest.py has three tests that validate the baseUrl resolves correctly for both environments:
def test_base_url_test_environment(self):
url = self.adyen.client._determine_api_url("test", self.baseUrl)
self.assertEqual(url, self.baseUrl)
self.assertTrue(url.startswith("https://pal-test.adyen.com/pal/servlet/Recurring/"))
def test_base_url_live_environment(self):
self.adyen.client.live_endpoint_prefix = "1797a841fbb37ca7-AdyenDemo"
recurring_version = self.baseUrl.split("/")[-1]
url = self.adyen.client._determine_api_url("live", self.baseUrl)
self.assertEqual(
url,
f"https://1797a841fbb37ca7-AdyenDemo-pal-live.adyenpayments.com"
f"/pal/servlet/Recurring/{recurring_version}",
)
self.adyen.client.live_endpoint_prefix = None
def test_base_url_live_environment_no_prefix_raises(self):
self.adyen.client.live_endpoint_prefix = None
self.assertRaises(
AdyenEndpointInvalidFormat,
self.adyen.client._determine_api_url,
"live",
self.baseUrl,
)
These tests are missing from all other service test files:
BalancePlatformTest.py
BinLookupTest.py
CapitalTest.py
CheckoutTest.py
DataProtectionTest.py
DisputesTest.py
LegalEntityManagementTest.py
ManagementTest.py
ModificationTest.py (payments)
PaymentTest.py
PosMobileTest.py
SessionAuthenticationTest.py
StoredValueTest.py
ThirdPartyPayoutTest.py
TransfersTest.py
Proposed Change
Add the equivalent of test_base_url_test_environment, test_base_url_live_environment, and test_base_url_live_environment_no_prefix_raises to each service test file, adapting the expected URLs to match the service's URL pattern (PAL, checkout, balancePlatform, management, etc.).
Note: test_base_url_live_environment_no_prefix_raises only applies to services that require a live_endpoint_prefix (i.e. PAL and checkout-based services).
Benefit
Ensures that URL resolution for both test and live environments is explicitly verified for every service, catching regressions in _determine_api_url early.
Context
RecurringTest.pyhas three tests that validate thebaseUrlresolves correctly for both environments:These tests are missing from all other service test files:
BalancePlatformTest.pyBinLookupTest.pyCapitalTest.pyCheckoutTest.pyDataProtectionTest.pyDisputesTest.pyLegalEntityManagementTest.pyManagementTest.pyModificationTest.py(payments)PaymentTest.pyPosMobileTest.pySessionAuthenticationTest.pyStoredValueTest.pyThirdPartyPayoutTest.pyTransfersTest.pyProposed Change
Add the equivalent of
test_base_url_test_environment,test_base_url_live_environment, andtest_base_url_live_environment_no_prefix_raisesto each service test file, adapting the expected URLs to match the service's URL pattern (PAL, checkout, balancePlatform, management, etc.).Note:
test_base_url_live_environment_no_prefix_raisesonly applies to services that require alive_endpoint_prefix(i.e. PAL and checkout-based services).Benefit
Ensures that URL resolution for both
testandliveenvironments is explicitly verified for every service, catching regressions in_determine_api_urlearly.