Stale Access application path-param tests expect valid account_id to raise
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
調査の方向性
tests/api_resources/zero_trust/access/test_applications.py にあるスキップされたパスパラメータのテストから着手してください。特に test_path_params_create_overload_1 と、sync および async の test_path_params_list ケースを確認します。それらの期待値を src/cloudflare/resources/zero_trust/access/applications/applications.py と比較し、その後、対象を絞ったアプリケーションテストを実行してください。完了の条件は、空でない account_id が受け入れられ、空または欠落しているアカウントおよびゾーンの識別子だけがエラーを発生させることです。
索引モデルが issue の本文から書いたものです。
説明
Confirm this is a Python library issue and not an underlying Cloudflare API issue.
- This is an issue with the Python library
Describe the bug
Some skipped path-param tests for zero_trust.access.applications appear to be stale after the account/zone path selection logic was fixed.
For example, these tests still expect ValueError("You must provide either account_id or zone_id") when account_id="account_id" is provided:
test_path_params_create_overload_1intests/api_resources/zero_trust/access/test_applications.pytest_path_params_listin both sync and async sections of the same file
That expectation now contradicts the current resource implementation, which correctly treats account_id as sufficient and builds an /accounts/{account_id}/... path. This looks related to the behavior discussed in #2705, where passing account_id should not require zone_id.
I noticed this while checking #2705. The runtime behavior on current main looks correct, but the skipped generated tests still encode the old/broken expectation.
To Reproduce
- Inspect the current
mainversion oftests/api_resources/zero_trust/access/test_applications.py. - See the valid-
account_idbranches in these tests:- https://github.com/cloudflare/cloudflare-python/blob/main/tests/api_resources/zero_trust/access/test_applications.py#L203-L218
- https://github.com/cloudflare/cloudflare-python/blob/main/tests/api_resources/zero_trust/access/test_applications.py#L3742-L3751
- https://github.com/cloudflare/cloudflare-python/blob/main/tests/api_resources/zero_trust/access/test_applications.py#L7675-L7684
- Compare with the current implementation in
src/cloudflare/resources/zero_trust/access/applications/applications.py, whereaccount_idselects theaccountspath and does not needzone_id. - A minimal local smoke check confirms the current behavior builds
GET /accounts/acct_123/access/appsforclient.zero_trust.access.applications.list(account_id="acct_123").
Expected: the path-param tests should only expect an error for empty/missing account and zone identifiers, not for a non-empty account_id.
Code snippets
client.zero_trust.access.applications.list(account_id="acct_123")
# current main builds: GET /accounts/acct_123/access/apps
OS
all
Python version
3.11.1
Library version
main / 5.7.0
- 主要言語
- Python
- スター
- 509
- フォーク
- 150
- 平均マージ
- 3時間 15分
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudflare/cloudflare-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
cloudflare/cloudflare-python#2718 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
cloudflare/cloudflare-python#2692 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
cloudflare/cloudflare-python#2679 · コメント 4 件 · リアクション 5 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
cloudflare/cloudflare-python#2745 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
cloudflare/cloudflare-python#2742 ·
cloudflare/cloudflare-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100