summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* chore: update type-hints return signature for GetWithoutIdMixin methodsJohn L. Villalovos2022-05-301-3/+3
| | | | | | | Commit f0152dc3cc9a42aa4dc3c0014b4c29381e9b39d6 removed situation where `get()` in a `GetWithoutIdMixin` based class could return `None` Update the type-hints to no longer return `Optional` AKA `None`
* 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-299-30/+295
|
* feat(client): introduce `iterator=True` and deprecate `as_list=False` in ↵John L. Villalovos2022-05-295-15/+44
| | | | | | | | | | | `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.
* refactor(mixins): extract custom type transforms into utilsNejc Habjan2022-05-291-1/+28
|
* feat(objects): support get project storage endpointNejc Habjan2022-05-272-0/+27
|
* Merge pull request #2012 from rnoberger/rnoberger/test-projectsNejc Habjan2022-05-111-20/+116
|\ | | | | test: increase projects coverage
| * test(projects): add tests for list project methodsRobin Berger2022-05-101-20/+116
| |
* | fix: duplicate subparsers being added to argparseJohn L. Villalovos2022-05-091-0/+0
| | | | | | | | | | | | | | | | | | | | Python 3.11 added an additional check in the argparse libary which detected duplicate subparsers being added. We had duplicate subparsers being added. Make sure we don't add duplicate subparsers. Closes: #2015
* | feat: display human-readable attribute in `repr()` if presentNejc Habjan2022-05-081-0/+31
|/
* 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
| |
* | Merge pull request #1963 from python-gitlab/feat/deploy-token-getMax Wittig2022-04-131-4/+9
|\ \ | | | | | | feat(objects): support getting project/group deploy tokens by id
| * | feat(objects): support getting project/group deploy tokens by idNejc Habjan2022-04-041-4/+9
| | |
* | | Merge pull request #1962 from python-gitlab/feat/user-ssh-keyMax Wittig2022-04-131-0/+3
|\ \ \ | | | | | | | | feat(user): support getting user SSH key by id
| * | | feat(user): support getting user SSH key by idNejc Habjan2022-04-011-0/+3
| |/ /
* | | feat: emit a warning when using a `list()` method returns maxJohn L. Villalovos2022-04-122-2/+145
| |/ |/| | | | | | | | | | | | | | | | | | | 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
|/
* chore(deps): upgrade gitlab-ce to 14.9.2-ce.0Nejc Habjan2022-04-011-1/+1
|
* feat(api): re-add topic delete endpointNejc Habjan2022-04-013-0/+23
| | | | This reverts commit e3035a799a484f8d6c460f57e57d4b59217cd6de.
* feat(object): add pipeline test report summary supportkinbald2022-03-071-1/+54
|
* feat(merge_request_approvals): add support for deleting MR approval rulesNejc Habjan2022-02-131-0/+18
|
* test(unit): clean up MR approvals fixturesNejc Habjan2022-02-131-123/+14
|
* feat(artifacts): add support for project artifacts delete APINejc Habjan2022-02-101-0/+18
|
* test(runners): add test for deleting runners by auth tokenNejc Habjan2022-02-101-1/+17
|
* chore: create a custom `warnings.warn` wrapperJohn L. Villalovos2022-02-061-0/+19
| | | | | | | Create a custom `warnings.warn` wrapper that will walk the stack trace to find the first frame outside of the `gitlab/` path to print the warning against. This will make it easier for users to find where in their code the error is generated from
* test(functional): fix GitLab configuration to support paginationJohn L. Villalovos2022-02-053-4/+4
| | | | | | | | | | | | When pagination occurs python-gitlab uses the URL provided by the GitLab server to use for the next request. We had previously set the GitLab server configuraiton to say its URL was `http://gitlab.test` which is not in DNS. Set the hostname in the URL to `http://127.0.0.1:8080` which is the correct URL for the GitLab server to be accessed while doing functional tests. Closes: #1877
* test(services): add functional tests for servicesNejc Habjan2022-02-032-1/+43
|
* test(objects): add tests for project artifactsNejc Habjan2022-02-012-7/+114
|
* fix: remove custom `delete` method for labelsJohn L. Villalovos2022-02-012-3/+10
| | | | | | | | | | | | | | The usage of deleting was incorrect according to the current API. Remove custom `delete()` method as not needed. Add tests to show it works with labels needing to be encoded. Also enable the test_group_labels() test function. Previously it was disabled. Add ability to do a `get()` for group labels. Closes: #1867
* chore: create new ArrayAttribute classJohn L. Villalovos2022-01-301-12/+30
| | | | | | | | | | | | | | | | | | | | | Create a new ArrayAttribute class. This is to indicate types which are sent to the GitLab server as arrays https://docs.gitlab.com/ee/api/#array At this stage it is identical to the CommaSeparatedListAttribute class but will be used later to support the array types sent to GitLab. This is the second step in a series of steps of our goal to add full support for the GitLab API data types[1]: * array * hash * array of hashes Step one was: commit 5127b1594c00c7364e9af15e42d2e2f2d909449b [1] https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types Related: #1698
* chore: remove redundant list comprehensionNejc Habjan2022-01-231-1/+1
|
* style: use f-strings where applicableNejc Habjan2022-01-232-11/+6
|
* chore: consistently use open() encoding and file descriptorNejc Habjan2022-01-232-4/+4
|
* chore: always use context manager for file IONejc Habjan2022-01-231-1/+2
|
* style: use literals to declare data structuresNejc Habjan2022-01-232-2/+2
|
* chore: remove old-style classesNejc Habjan2022-01-232-4/+4
|
* chore: rename `types.ListAttribute` to `types.CommaSeparatedListAttribute`John L. Villalovos2022-01-221-12/+12
| | | | | | | | | | | This name more accurately describes what the type is. Also this is the first step in a series of steps of our goal to add full support for the GitLab API data types[1]: * array * hash * array of hashes [1] https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types
* test: add a meta test to make sure that v4/objects/ files are importedJohn L. Villalovos2022-01-221-0/+32
| | | | | Add a test to make sure that all of the `gitlab/v4/objects/` files are imported in `gitlab/v4/objects/__init__.py`
* fix(cli): allow custom methods in managersNejc Habjan2022-01-222-0/+36
|
* fix(objects): make resource access tokens and repos available in CLINejc Habjan2022-01-221-0/+16
|
* test: convert usage of `match_querystring` to `match`jlvillal/rm_httmockJohn L. Villalovos2022-01-164-101/+104
| | | | | 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.
* Merge pull request #1838 from python-gitlab/jlvillal/version_mvNejc Habjan2022-01-151-1/+1
|\ | | | | chore: rename `gitlab/__version__.py` to `gitlab/_version.py`
| * chore: rename `gitlab/__version__.py` -> `gitlab/_version.py`jlvillal/version_mvJohn L. Villalovos2022-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is confusing to have a `gitlab/__version__.py` because we also create a variable `gitlab.__version__` which can conflict with `gitlab/__version__.py`. For example in `gitlab/const.py` we have to know that `gitlab.__version__` is a module and not the variable due to the ordering of imports. But in most other usage `gitlab.__version__` is a version string. To reduce confusion make the name of the version file `gitlab/_version.py`.
* | test: use 'responses' in test_mixins_methods.pyJohn L. Villalovos2022-01-141-146/+191
| | | | | | | | | | | | Convert from httmock to responses in test_mixins_methods.py This leaves only one file left to convert
* | chore(tests): use method `projects.transfer()`jlvillal/catch_warningsJohn L. Villalovos2022-01-131-2/+2
|/ | | | | | When doing the functional tests use the new function `projects.transfer` instead of the deprecated function `projects.transfer_project()`
* test(groups): enable group transfer testsNejc Habjan2022-01-133-10/+11
|
* feat(api): add `project.transfer()` and deprecate `transfer_project()`Nejc Habjan2022-01-134-5/+78
|
* Merge pull request #1819 from python-gitlab/jlvillal/encoded_idNejc Habjan2022-01-136-15/+134
|\ | | | | fix: use url-encoded ID in all paths