Skip to content

Commit ceee545

Browse files
committed
add tests for payment urls
1 parent d53d517 commit ceee545

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/CheckoutTest.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,3 +529,24 @@ def test_update_payment_link(self):
529529
)
530530
self.assertEqual("expired",result.message["status"])
531531

532+
def test_service_name_validation(self):
533+
"""
534+
This test prevents a regression of a bug found in the Adyen Ruby library
535+
where the `service` attribute of the `PaymentsApi` class was being
536+
overridden due to the way Ruby handles open classes.
537+
538+
This test validates that the `service` and `baseUrl` attributes of the
539+
`payments_api` for both `checkout` and `payment` are set correctly and
540+
are not being overridden by ensuring that each service has its own
541+
`PaymentsApi` class in a separate module.
542+
"""
543+
checkout_service = self.adyen.checkout.payments_api.service
544+
payment_service = self.adyen.payment.payments_api.service
545+
checkout_base_url = self.adyen.checkout.payments_api.baseUrl
546+
payment_base_url = self.adyen.payment.payments_api.baseUrl
547+
548+
self.assertEqual("checkout", checkout_service)
549+
self.assertEqual("payments", payment_service)
550+
self.assertTrue(checkout_base_url.startswith("https://checkout-test.adyen.com/"))
551+
self.assertTrue(payment_base_url.startswith("https://pal-test.adyen.com/pal/servlet/Payment/"))
552+

0 commit comments

Comments
 (0)