summaryrefslogtreecommitdiff
path: root/tests/unit/test_gitlab.py
Commit message (Collapse)AuthorAgeFilesLines
* feat: allow passing kwargs to Gitlab class when instantiating with ↵Liora Milbaum2022-12-041-0/+23
| | | | `from_config` (#2392)
* chore: consolidate license and authorsNejc Habjan2022-08-041-18/+0
|
* feat(client): warn user on misconfigured URL in `auth()`Nejc Habjan2022-08-041-1/+23
|
* fix: optionally keep user-provided base URL for pagination (#2149)Omar Mochtar2022-08-031-0/+55
|
* test: always ensure clean config environmentNejc Habjan2022-07-261-6/+1
|
* test: fix broken test if user had config filesJohn L. Villalovos2022-07-231-1/+6
| | | | | | | Use `monkeypatch` to ensure that no config files are reported for the test. Closes: #2172
* fix(config): raise error when gitlab id provided but no config section foundNejc Habjan2022-07-221-1/+6
|
* fix(config): raise error when gitlab id provided but no config file foundNejc Habjan2022-07-221-0/+6
|
* fix: add `get_all` param (and `--get-all`) to allow passing `all` to APINejc Habjan2022-07-211-2/+2
|
* test: add tests and clean up usage for new enumsNejc Habjan2022-06-271-13/+21
|
* test: increase client coverageNejc Habjan2022-06-021-0/+24
|
* chore: correct ModuleNotFoundError() argumentsJohn L. Villalovos2022-05-291-1/+1
| | | | | | | | | | | Previously in commit 233b79ed442aac66faf9eb4b0087ea126d6dffc5 I had used the `name` argument for `ModuleNotFoundError()`. This basically is the equivalent of not passing any message to `ModuleNotFoundError()`. So when the exception was raised it wasn't very helpful. Correct that and add a unit-test that shows we get the message we expect.
* test(gitlab): increase unit test coverageNejc Habjan2022-05-291-1/+60
|
* feat(client): introduce `iterator=True` and deprecate `as_list=False` in ↵John L. Villalovos2022-05-291-4/+4
| | | | | | | | | | | `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.
* test: convert usage of `match_querystring` to `match`jlvillal/rm_httmockJohn L. Villalovos2022-01-161-2/+1
| | | | | In the `responses` library the usage of `match_querystring` is deprecated. Convert to using `match`
* fix: handle situation where GitLab does not return valuesjlvillal/paginationJohn L. Villalovos2021-12-301-3/+2
| | | | | | | | | | | | | | | | If a query returns more than 10,000 records than the following values are NOT returned: x.total_pages x.total Modify the code to allow no value to be set for these values. If there is not a value returned the functions will now return None. Update unit test so no longer `xfail` https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers Closes #1686
* test: reproduce missing pagination headers in testsNejc Habjan2021-12-301-0/+30
|
* test: drop httmock dependency in test_gitlab.pyNejc Habjan2021-12-301-45/+61
|
* chore: use constants from gitlab.const moduleJohn L. Villalovos2021-11-301-6/+6
| | | | | Have code use constants from the gitlab.const module instead of from the top-level gitlab module.
* refactor: deprecate accessing constants from top-level namespaceJohn L. Villalovos2021-11-301-16/+31
| | | | | | | | | | | | | | We are planning on adding enumerated constants into gitlab/const.py, but if we do that than they will end up being added to the top-level gitlab namespace. We really want to get users to start using `gitlab.const.` to access the constant values in the future. Add the currently defined constants to a list that should not change. Use a module level __getattr__ function so that we can deprecate access to the top-level constants. Add a unit test which verifies we generate a warning when accessing the top-level constants.
* refactor: use f-strings for string formattingNejc Habjan2021-11-051-3/+1
|
* feat: default to gitlab.com if no URL givenNejc Habjan2021-09-081-1/+44
| | | | | BREAKING CHANGE: python-gitlab will now default to gitlab.com if no URL is given
* chore: move 'gitlab/tests/' dir to 'tests/unit/'John L. Villalovos2021-05-261-0/+153
Move the 'gitlab/tests/' directory to 'tests/unit/' so we have all the tests located under the 'tests/' directory.