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

Stale Access application path-param tests expect valid account_id to raise

未关闭 适合新手
#2,747 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
api, testing

调研方向

从 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_1 in tests/api_resources/zero_trust/access/test_applications.py
  • test_path_params_list in 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
  1. Inspect the current main version of tests/api_resources/zero_trust/access/test_applications.py.
  2. See the valid-account_id branches in these tests:
  3. Compare with the current implementation in src/cloudflare/resources/zero_trust/access/applications/applications.py, where account_id selects the accounts path and does not need zone_id.
  4. A minimal local smoke check confirms the current behavior builds GET /accounts/acct_123/access/apps for client.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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

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

cloudflare/cloudflare-python 的其他 Issue

查看 cloudflare/cloudflare-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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