summaryrefslogtreecommitdiff
path: root/tests/unit/test_gitlab_http_methods.py
Commit message (Collapse)AuthorAgeFilesLines
* feat(client): add http_patch method (#2471)John Villalovos2023-02-051-0/+50
| | | | | In order to support some new API calls we need to support the HTTP `PATCH` method. Closes: #2469
* chore: add a UserWarning if both `iterator=True` and `page=X` are used (#2462)John Villalovos2023-01-261-1/+12
| | | | | If a caller calls a `list()` method with both `iterator=True` (or `as_list=False`) and `page=X` then emit a `UserWarning` as the options are mutually exclusive.
* fix(client): regression - do not automatically get_next if page=# andHelen Koike2023-01-251-0/+12
| | | | | | | | | | | | | iterator=True/as_list=False are used This fix a regression introduced on commit https://github.com/python-gitlab/python-gitlab/commit/1339d645ce58a2e1198b898b9549ba5917b1ff12 If page is used, then get_next should be false. This was found on the mesa ci project, after upgrading the python-gitlab version, the script that monitors the ci was getting killed by consuming too much memory.
* chore: add test, docs, and helper for 409 retriesNejc Habjan2022-12-191-0/+57
|
* refactor: Moving RETRYABLE_TRANSIENT_ERROR_CODES to constLiora Milbaum2022-12-061-1/+1
|
* test(unit): reproduce duplicate encoded query paramsNejc Habjan2022-08-041-0/+18
|
* fix: add `get_all` param (and `--get-all`) to allow passing `all` to APINejc Habjan2022-07-211-2/+2
|
* test(api): add tests for HEAD methodNejc Habjan2022-06-251-0/+16
|
* test(gitlab): increase unit test coverageNejc Habjan2022-05-291-23/+21
|
* feat(client): introduce `iterator=True` and deprecate `as_list=False` in ↵John L. Villalovos2022-05-291-5/+23
| | | | | | | | | | | `list()` `as_list=False` is confusing as it doesn't explain what is being returned. Replace it with `iterator=True` which more clearly explains to the user that an iterator/generator will be returned. This maintains backward compatibility with `as_list` but does issue a DeprecationWarning if `as_list` is set.
* Merge pull request #1974 from ↵Nejc Habjan2022-04-141-2/+11
|\ | | | | | | | | Sineaggi/add-chunked-to-list-of-retryable-exceptions Add ChunkedEncodingError to list of retryable exceptions
| * fix: add ChunkedEncodingError to list of retryable exceptionsClayton Walker2022-04-131-2/+11
| |
* | feat: emit a warning when using a `list()` method returns maxJohn L. Villalovos2022-04-121-2/+100
|/ | | | | | | | | | | A common cause of issues filed and questions raised is that a user will call a `list()` method and only get 20 items. As this is the default maximum of items that will be returned from a `list()` method. To help with this we now emit a warning when the result from a `list()` method is greater-than or equal to 20 (or the specified `per_page` value) and the user is not using either `all=True`, `all=False`, `as_list=False`, or `page=X`.
* fix: add 52x range to retry transient failures and testsClayton Walker2022-04-041-1/+97
|
* test: convert usage of `match_querystring` to `match`jlvillal/rm_httmockJohn L. Villalovos2022-01-161-87/+25
| | | | | In the `responses` library the usage of `match_querystring` is deprecated. Convert to using `match`
* test: remove usage of httpmock libraryJohn L. Villalovos2022-01-151-223/+388
| | | | | Convert all usage of the `httpmock` library to using the `responses` library.
* fix!: raise error if there is a 301/302 redirectionJohn L. Villalovos2021-09-081-2/+89
| | | | | | | | | | | | | | | | | | | | | | | | | Before we raised an error if there was a 301, 302 redirect but only from an http URL to an https URL. But we didn't raise an error for any other redirects. This caused two problems: 1. PUT requests that are redirected get changed to GET requests which don't perform the desired action but raise no error. This is because the GET response succeeds but since it wasn't a PUT it doesn't update. See issue: https://github.com/python-gitlab/python-gitlab/issues/1432 2. POST requests that are redirected also got changed to GET requests. They also caused hard to debug tracebacks for the user. See issue: https://github.com/python-gitlab/python-gitlab/issues/1477 Correct this by always raising a RedirectError exception and improve the exception message to let them know what was redirected. Closes: #1485 Closes: #1432 Closes: #1477
* feat: allow global retry_transient_errors setupKarun Japhet2021-08-291-5/+90
| | | | | | `retry_transient_errors` can now be set through the Gitlab instance and global configuration Documentation for API usage has been updated and missing tests have been added.
* chore: move 'gitlab/tests/' dir to 'tests/unit/'John L. Villalovos2021-05-261-0/+234
Move the 'gitlab/tests/' directory to 'tests/unit/' so we have all the tests located under the 'tests/' directory.