summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* refactor(objects): move ci lint to separate fileNejc Habjan2022-07-052-46/+49
|
* feat(objects): add Project CI Lint supportJohn L. Villalovos2022-07-041-0/+46
| | | | | | Add support for validating a project's CI configuration [1] [1] https://docs.gitlab.com/ee/api/lint.html
* feat: add support for group push rulesO'Keefe, Gerard (Gerry)2022-07-041-0/+103
| | | | | | Add the GroupPushRules and GroupPushRulesManager classes. Closes: #1259
* test(functional): replace len() calls with list membership checksNejc Habjan2022-07-0314-172/+163
|
* fix: ensure path elements are escapedJohn L. Villalovos2022-07-031-1/+1
| | | | | | | Ensure the path elements that are passed to the server are escaped. For example a "/" will be changed to "%2F" Closes: #2116
* Merge pull request #2069 from antoineauger/test/unit-tests-projectsNejc Habjan2022-06-293-107/+538
|\ | | | | test(projects): add unit tests for projects
| * refactor(test-projects): apply suggestions and use fixturesAntoine Auger2022-06-291-27/+26
| |
| * refactor(test-projects): remove test_restore_projectAntoine Auger2022-06-161-5/+0
| |
| * test(projects): add unit tests for projectsAntoine Auger2022-06-163-100/+537
| |
* | Merge pull request #2110 from python-gitlab/jlvillal/mr_approval_rulesNejc Habjan2022-06-281-0/+18
|\ \ | | | | | | feat(api): add support for `get` for a MR approval rule
| * | feat(api): add support for `get` for a MR approval ruleJohn L. Villalovos2022-06-271-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | In GitLab 14.10 they added support to get a single merge request approval rule [1] Add support for it to ProjectMergeRequestApprovalRuleManager [1] https://docs.gitlab.com/ee/api/merge_request_approvals.html#get-a-single-merge-request-level-rule
* | | chore: fix misspellingJohn L. Villalovos2022-06-271-1/+1
|/ /
* | test: add tests and clean up usage for new enumsNejc Habjan2022-06-275-24/+63
| |
* | refactor: avoid possible breaking change in iterator (#2107)John Villalovos2022-06-271-1/+1
| | | | | | | | | | | | | | | | Commit b6447211754e126f64e12fc735ad74fe557b7fb4 inadvertently introduced a possible breaking change as it added a new argument `iterator` and added it in between existing (potentially positional) arguments. This moves the `iterator` argument to the end of the argument list and requires it to be a keyword-only argument.
* | feat(downloads): allow streaming downloads access to response iterator (#1956)Tom Catshoek2022-06-262-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat(downloads): allow streaming downloads access to response iterator Allow access to the underlying response iterator when downloading in streaming mode by specifying `iterator=True`. Update type annotations to support this change. * docs(api-docs): add iterator example to artifact download Document the usage of the `iterator=True` option when downloading artifacts * test(packages): add tests for streaming downloads
* | refactor: remove no-op id argument in GetWithoutIdMixinNejc Habjan2022-06-251-5/+3
| |
* | Merge pull request #2061 from bgamari/patch-1Nejc Habjan2022-06-251-0/+34
|\ \ | | | | | | feat(users): add approve and reject methods to User
| * | feat(users): add approve and reject methods to UserBen Gamari2022-06-251-0/+34
| | | | | | | | | | | | | | | | | | As requested in #1604. Co-authored-by: John Villalovos <john@sodarock.com>
* | | feat(api): support head() method for get and list endpointsNejc Habjan2022-06-253-0/+34
| | |
* | | test(api): add tests for HEAD methodNejc Habjan2022-06-251-0/+16
|/ /
* | chore(ci): increase timeout for docker container to come onlineJohn L. Villalovos2022-06-241-4/+16
| | | | | | | | | | Have been seeing timeout issues more and more. Increase timeout from 200 seconds to 300 seconds (5 minutes).
* | feat: Add support for Protected Environmentscalve2022-06-221-1/+26
| | | | | | | | | | | | | | | | - https://docs.gitlab.com/ee/api/protected_environments.html - https://github.com/python-gitlab/python-gitlab/issues/1130 no write operation are implemented yet as I have no use case right now and am not sure how it should be done
* | fix(base): do not fail repr() on lazy objectsNejc Habjan2022-06-201-0/+4
| |
* | Merge pull request #2066 from python-gitlab/jlvillal/approval_rule_idNejc Habjan2022-06-201-0/+1
|\ \ | |/ |/| fix(cli): project-merge-request-approval-rule
| * fix(cli): project-merge-request-approval-ruleJohn L. Villalovos2022-06-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the CLI the command: gitlab project-merge-request-approval-rule list --mr-iid 1 --project-id foo/bar Would raise an exception. This was due to the fact that `_id_attr` and `_repr_attr` were set for keys which are not returned in the response. Add a unit test which shows the `repr` function now works. Before it did not. This is an EE feature so we can't functional test it. Closes: #2065
* | feat(users): add ban and unban methodsAntoine Auger2022-06-132-0/+44
|/
* Merge pull request #2045 from python-gitlab/jlvillal/test_validate_attrsNejc Habjan2022-06-051-0/+49
|\ | | | | test: add more tests for RequiredOptional
| * test: add more tests for RequiredOptionalJohn L. Villalovos2022-06-011-0/+49
| |
* | chore: rename `whaction` and `action` to `resource_action` in CLIJohn L. Villalovos2022-06-051-1/+1
| | | | | | | | | | Rename the variables `whaction` and `action` to `resource_action` to improve code-readability.
* | chore: rename `what` to `gitlab_resource`John L. Villalovos2022-06-031-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Naming a variable `what` makes it difficult to understand what it is used for. Rename it to `gitlab_resource` as that is what is being stored. The Gitlab documentation talks about them being resources: https://docs.gitlab.com/ee/api/api_resources.html This will improve code readability.
* | test: increase client coverageNejc Habjan2022-06-022-0/+39
|/
* test(cli): improve coverage for custom actionsNejc Habjan2022-06-012-4/+38
|
* fix(cli): fix project export download for CLINejc Habjan2022-06-011-0/+34
| | | | | Since ac1c619cae6481833f5df91862624bf0380fef67 we delete parent arg keys from the args dict so this has been trying to access the wrong attribute.
* chore: move `utils._validate_attrs` inside `types.RequiredOptional`John L. Villalovos2022-05-311-5/+4
| | | | | | Move the `validate_attrs` function to be inside the `RequiredOptional` class. It makes sense for it to be part of the class as it is working on data related to the class.
* chore: have `EncodedId` creation always return `EncodedId`John L. Villalovos2022-05-311-2/+4
| | | | | | | | There is no reason to return an `int` as we can always return a `str` version of the `int` Change `EncodedId` to always return an `EncodedId`. This removes the need to have `mypy` ignore the error raised.
* feat: support mutually exclusive attributes and consolidate validation to ↵Walter Rowe2022-05-311-4/+5
| | | | | | | | | | | | | | | fix board lists (#2037) add exclusive tuple to RequiredOptional data class to support for mutually exclusive attributes consolidate _check_missing_create_attrs and _check_missing_update_attrs from mixins.py into _validate_attrs in utils.py change _create_attrs in board list manager classes from required=('label_ld',) to exclusive=('label_id','asignee_id','milestone_id') closes https://github.com/python-gitlab/python-gitlab/issues/1897
* chore: move `RequiredOptional` to the `gitlab.types` moduleJohn L. Villalovos2022-05-311-10/+11
| | | | | | By having `RequiredOptional` in the `gitlab.base` module it makes it difficult with circular imports. Move it to the `gitlab.types` module which has no dependencies on any other gitlab module.
* 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