Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Test] Add baseUrl environment tests to all service test files

Aperta
#475 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@gourabsingha1 ci sta già lavorando.

Dal 22/6/2026.

  • #488 di @gourabsingha1 — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
api, testing-qa

Direzione di ricerca

Inizia con RecurringTest.py e confronta i suoi tre test di baseUrl con i file di test dei servizi elencati. Aggiungi una copertura equivalente per l’ambiente di test e l’ambiente live utilizzando il modello di URL di ciascun servizio, applicando il caso senza prefisso solo a PAL e ai servizi basati su checkout. Esegui i test dei servizi interessati e conferma che ogni file elencato disponga della copertura appropriata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

do not stale Test

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.

Lingua principale
Python
Stelle
68
Fork
51
Merge medio
2h 3m
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Adyen/adyen-python-api-library

Tutte le issue di Adyen/adyen-python-api-library

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.