Stale Access application path-param tests expect valid account_id to raise
还没有人认领这个 Issue。
评估
调研方向
从 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
- 星标
- 512
- 派生
- 155
- 平均合并
- 2 小时 2 分钟
- 30 天内合并 PR
- 2
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
cloudflare/cloudflare-python#2745 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 25/100
cloudflare/cloudflare-python#2742 ·
查看 cloudflare/cloudflare-python 的全部 Issue
相似的 Issue
-
comp/tools duplicate P2 sweeper:risk-compatibility tool/mcp type/bug
难度 1/5 1 小时以内 新手友好度 88/100
NousResearch/hermes-agent#132042 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
deepset-ai/haystack#13092 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
EverMind-AI/Raven#845 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
AstrBotDevs/AstrBot#10340 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
BasedHardware/omi#20401 · 1 条评论 ·
维护者通常 1 天内回复