Stale Access application path-param tests expect valid account_id to raise
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start with the skipped path-param tests in tests/api_resources/zero_trust/access/test_applications.py, especially test_path_params_create_overload_1 and the sync and async test_path_params_list cases. Compare their expectations with src/cloudflare/resources/zero_trust/access/applications/applications.py, then run the focused application tests. Done means a non-empty account_id is accepted and only empty or missing account and zone identifiers raise errors.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Python
- Stars
- 509
- Forks
- 150
- Avg merge
- 3h 15m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/cloudflare-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
cloudflare/cloudflare-python#2718 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
cloudflare/cloudflare-python#2692 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
cloudflare/cloudflare-python#2679 · 4 comments · 5 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
cloudflare/cloudflare-python#2745 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
cloudflare/cloudflare-python#2742 ·
All issues in cloudflare/cloudflare-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Openarea: ci bug perceived difficulty: 3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ClickHouse/clickhouse-connect#1057 ·