[Test] Add baseUrl environment tests to all service test files
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- python
- 领域
- api, testing-qa
调研方向
从 RecurringTest.py 开始,将其中的三个 baseUrl 测试与列出的服务测试文件进行比较。使用每个服务的 URL 模式,为测试环境和线上环境添加等效覆盖,并且仅对 PAL 和基于 checkout 的服务应用无前缀情况。运行受影响服务的测试,并确认列出的每个文件都具有适当的覆盖。
由索引模型根据 Issue 内容生成。
描述
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.pyBinLookupTest.pyCapitalTest.pyCheckoutTest.pyDataProtectionTest.pyDisputesTest.pyLegalEntityManagementTest.pyManagementTest.pyModificationTest.py(payments)PaymentTest.pyPosMobileTest.pySessionAuthenticationTest.pyStoredValueTest.pyThirdPartyPayoutTest.pyTransfersTest.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
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Adyen/adyen-python-api-library 的其他 Issue
-
[Bug] api_*_version override has no effect on PAL-based service URLs可能已有人在做 @cobanfurkanx 于 10 天前认领。 未关闭Bug do not stale
难度 2/5 1-3 小时 新手友好度 75/100
-
Feature
难度 4/5 3-5 天 新手友好度 45/100
Adyen/adyen-python-api-library#487 · 1 条评论 · 1 个 reaction ·
-
chore: consolidate package metadata into pyproject.toml (PEP 621)可能已有人在做 @erdemtuna 于 192 天前认领。 未关闭do not stale
难度 3/5 1-2 天 新手友好度 72/100
-
[Bug]: Unknown properties return None可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭do not stale
难度 2/5 1-3 小时 新手友好度 48/100
Adyen/adyen-python-api-library#397 · 2 条评论 ·
-
do not stale Feature
难度 5/5 一周以上 新手友好度 35/100
Adyen/adyen-python-api-library#395 · 1 个 reaction ·
查看 Adyen/adyen-python-api-library 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
omegaup/omegaup#10353 · 1 条评论 ·
维护者通常 5 天内回复
-
bot-triaged module: LrScheduler module: optimizer triaged
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
documentation glm5 llm-model
难度 2/5 1-3 小时 新手友好度 78/100
vllm-project/vllm-ascend#19062 ·
维护者通常 1 天内回复
-
author-page correction
难度 2/5 1-3 小时 新手友好度 68/100
acl-org/acl-anthology#10496 · 1 条评论 ·
维护者通常 1 天内回复