Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#475 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@gourabsingha1 已经在做这个了。

开始于 2026年6月22日。

  • #488 来自 @gourabsingha1 —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
python
领域
api, testing-qa

调研方向

从 RecurringTest.py 开始,将其中的三个 baseUrl 测试与列出的服务测试文件进行比较。使用每个服务的 URL 模式,为测试环境和线上环境添加等效覆盖,并且仅对 PAL 和基于 checkout 的服务应用无前缀情况。运行受影响服务的测试,并确认列出的每个文件都具有适当的覆盖。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Python
星标
68
派生
51
平均合并
2 小时 3 分钟
30 天内合并 PR
2

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Adyen/adyen-python-api-library 的其他 Issue

查看 Adyen/adyen-python-api-library 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。