Stale Access application path-param tests expect valid account_id to raise
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
Direzione di ricerca
Inizia con i test saltati dei parametri del percorso in tests/api_resources/zero_trust/access/test_applications.py, in particolare test_path_params_create_overload_1 e i casi sync e async di test_path_params_list. Confronta le relative aspettative con src/cloudflare/resources/zero_trust/access/applications/applications.py, quindi esegui i test mirati dell’applicazione. Il lavoro è completo quando un account_id non vuoto viene accettato e solo gli identificatori di account e zona vuoti o mancanti generano errori.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 509
- Fork
- 150
- Merge medio
- 3h 15m
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudflare/cloudflare-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
cloudflare/cloudflare-python#2718 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
cloudflare/cloudflare-python#2692 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
cloudflare/cloudflare-python#2679 · 4 commenti · 5 reazioni ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
cloudflare/cloudflare-python#2745 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
cloudflare/cloudflare-python#2742 ·
Tutte le issue di cloudflare/cloudflare-python
Issue simili
-
bug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
open-webui/open-webui#30750 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100