[Test] Add baseUrl environment tests to all service test files
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- python
- 領域
- api, testing-qa
調査の方向性
RecurringTest.py から始め、その3つの 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分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 件 ·
-
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対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンdo not stale
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
Adyen/adyen-python-api-library#397 · コメント 2 件 ·
-
do not stale Feature
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
Adyen/adyen-python-api-library#395 · リアクション 1 件 ·
Adyen/adyen-python-api-library の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
UKGovernmentBEIS/control-arena#917 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
debpalash/VoiceStudio#2937 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aws-samples/sample-per-model-bedrock#261 ·
メンテナーはふだん 1 日以内に返信