summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * chore: fixtures: after delete() wait to verify deletedJohn L. Villalovos2022-07-212-29/+50
| | | | | | | | | | | | | | | | | | | | | | | | In our fixtures that create: - groups - project merge requests - projects - users They delete the created objects after use. Now wait to ensure the objects are deleted before continuing as having unexpected objects existing can impact some of our tests.
* | test(api_func_v4): catch deprecation warning for `gl.lint()`John L. Villalovos2022-07-211-1/+2
|/ | | | | Catch the deprecation warning for the call to `gl.lint()`, so it won't show up in the log.
* test(functional): use both get_all and all in list() testsNejc Habjan2022-07-211-11/+22
|
* fix: add `get_all` param (and `--get-all`) to allow passing `all` to APINejc Habjan2022-07-219-71/+111
|
* Merge pull request #1872 from python-gitlab/jlvillal/as_dictNejc Habjan2022-07-201-0/+97
|\ | | | | feat: add `asdict()` and `to_json()` methods to Gitlab Objects
| * feat: add `asdict()` and `to_json()` methods to Gitlab ObjectsJohn L. Villalovos2022-07-201-8/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an `asdict()` method that returns a dictionary representation copy of the Gitlab Object. This is a copy and changes made to it will have no impact on the Gitlab Object. The `asdict()` method name was chosen as both the `dataclasses` and `attrs` libraries have an `asdict()` function which has the similar purpose of creating a dictionary represenation of an object. Also add a `to_json()` method that returns a JSON string representation of the object. Closes: #1116
| * fix: results returned by `attributes` property to show updatesJohn L. Villalovos2022-07-201-0/+26
| | | | | | | | | | | | | | | | | | Previously the `attributes` method would show the original values in a Gitlab Object even if they had been updated. Correct this so that the updated value will be returned. Also use copy.deepcopy() to ensure that modifying the dictionary returned can not also modify the object.
* | chore: add a `lazy` boolean attribute to `RESTObject`John L. Villalovos2022-07-201-0/+43
|/ | | | | | | | This can be used to tell if a `RESTObject` was created using `lazy=True`. Add a message to the `AttributeError` if attribute access fails for an instance created with `lazy=True`.
* test: add more tests for container registriesNejc Habjan2022-07-201-4/+50
|
* feat(groups): add support for group-level registry repositoriesNejc Habjan2022-07-201-0/+47
|
* chore: enable mypy check `strict_equality`John L. Villalovos2022-07-191-2/+14
| | | | Enable the `mypy` `strict_equality` check.
* feat: support validating CI lint resultsNejc Habjan2022-07-093-8/+102
|
* feat(cli): add support for global CI lintNejc Habjan2022-07-051-11/+33
|
* 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.