Replace limit=0 query parameter to avoid 400 Bad Request responses #302
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue being resolved: #301
Solution description
How are we solving the problem?
__get_all_entities() method needs more work than this easy fix.
response.response_text["_links"]["next"]and the link inside does not contain?marking the start of query parameters so it is not easy to parse with built-in libraries (e.g.urllib.parse.urlparse())Pay attention to this URL
url: https://<redacted>/api/v2/get_sections/<project_id>&suite_id=<suite_id>&limit=0&offset=0There is no
?so technically (based onurllib.parse.urlparse) there are no query parameters at all.limit=0string exists inresponse.response_text["_links"]["next"]and if that's true, we replace it withlimit=250Changes
Explained above
Potential impacts
Don't see. Ideally it should not be a hardcoded value. Maybe it should be investigated further why TestRail API returns such link in
response.response_text["_links"]["next"]bodies.Steps to test
Follow reproduction steps from #301
PR Tasks