summaryrefslogtreecommitdiff
path: root/gitlab/tests
Commit message (Collapse)AuthorAgeFilesLines
* chore: move 'gitlab/tests/' dir to 'tests/unit/'John L. Villalovos2021-05-2655-5852/+0
| | | | | Move the 'gitlab/tests/' directory to 'tests/unit/' so we have all the tests located under the 'tests/' directory.
* feat(objects): add support for billable membersNejc Habjan2021-05-251-0/+58
|
* chore: fix import ordering using isortJohn L. Villalovos2021-05-2524-27/+10
| | | | | | Fix the import ordering using isort. https://pycqa.github.io/isort/
* test(cli): add more real class scenariosNejc Habjan2021-05-151-0/+6
|
* fix(cli): fix parsing CLI objects to classnamesNejc Habjan2021-05-151-10/+27
|
* Merge pull request #1444 from python-gitlab/fix/return-retry-cancel-outputMax Wittig2021-05-022-0/+192
|\ | | | | fix(objects): return server data in cancel/retry methods
| * fix(objects): return server data in cancel/retry methodsNejc Habjan2021-05-022-0/+192
| |
* | chore: mypy: Disallow untyped definitionsJohn L. Villalovos2021-04-271-3/+2
|/ | | | | | | | | Be more strict and don't allow untyped definitions on the files we check. Also this adds type-hints for two of the decorators so that now functions/methods decorated by them will have their types be revealed correctly.
* Merge pull request #1352 from JohnVillalovos/jlvillal/fix_mroNejc Habjan2021-04-271-0/+122
|\ | | | | fix: add a check to ensure the MRO is correct
| * chore: remove commented-out printNejc Habjan2021-04-271-1/+0
| |
| * fix: add a check to ensure the MRO is correctJohn L. Villalovos2021-04-241-0/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a check to ensure the MRO (Method Resolution Order) is correct for classes in gitlab.v4.objects when doing type-checking. An example of an incorrect definition: class ProjectPipeline(RESTObject, RefreshMixin, ObjectDeleteMixin): ^^^^^^^^^^ This should be at the end. Correct way would be: class ProjectPipeline(RefreshMixin, ObjectDeleteMixin, RESTObject): Correctly at the end ^^^^^^^^^^ Also fix classes which have the issue.
* | Merge pull request #1415 from JohnVillalovos/jlvillal/list_attribute_intNejc Habjan2021-04-271-0/+5
|\ \ | | | | | | feat: add support for lists of integers to ListAttribute
| * | feat: add support for lists of integers to ListAttributeJohn L. Villalovos2021-04-251-0/+5
| |/ | | | | | | | | | | | | | | | | Previously ListAttribute only support lists of integers. Now be more flexible and support lists of items which can be coerced into strings, for example integers. This will help us fix issue #1407 by using ListAttribute for the 'iids' field.
* | fix(files): do not url-encode file paths twiceNejc Habjan2021-04-261-0/+49
|/
* Merge pull request #1397 from JohnVillalovos/jlvillal/flake8Max Wittig2021-04-2311-50/+45
|\ | | | | Fix all issues reported by running: tox -e pep8 and enable pep8 as a linter check
| * chore: fix F841 errors reported by flake8John L. Villalovos2021-04-182-2/+2
| | | | | | | | | | | | Local variable name is assigned to but never used https://www.flake8rules.com/rules/F841.html
| * chore: fix F401 errors reported by flake8John L. Villalovos2021-04-184-7/+2
| | | | | | | | | | | | F401: Module imported but unused https://www.flake8rules.com/rules/F401.html
| * chore: fix E711 error reported by flake8John L. Villalovos2021-04-182-7/+7
| | | | | | | | | | | | E711: Comparison to none should be 'if cond is none:' https://www.flake8rules.com/rules/E711.html
| * chore: fix E712 errors reported by flake8John L. Villalovos2021-04-184-14/+14
| | | | | | | | | | | | E712: Comparison to true should be 'if cond is true:' or 'if cond:' https://www.flake8rules.com/rules/E712.html
| * chore: fix E741/E742 errors reported by flake8John L. Villalovos2021-04-183-20/+20
| | | | | | | | | | | | | | | | | | Fixes to resolve errors for: https://www.flake8rules.com/rules/E741.html Do not use variables named 'I', 'O', or 'l' (E741) https://www.flake8rules.com/rules/E742.html Do not define classes named 'I', 'O', or 'l' (E742)
* | Merge pull request #1383 from spyoungtech/dirfixNejc Habjan2021-04-211-0/+4
|\ \ | | | | | | fix(types): prevent __dir__ in RestObject from producing duplicates
| * | test(object): add test for __dir__ duplicatesSpencer Phillip Young2021-04-211-0/+4
| | |
* | | chore: remove unused function sanitize_parameters()John L. Villalovos2021-04-181-20/+0
| | | | | | | | | | | | | | | | | | The function sanitize_parameters() was used when the v3 API was in use. Since v3 API support has been removed there are no more users of this function.
* | | test(objects): add tests for resource state eventsNejc Habjan2021-04-182-0/+115
| |/ |/|
* | Merge pull request #1359 from klorenz/feat_token_lookupNejc Habjan2021-04-181-0/+38
|\ \ | | | | | | feat(config): allow using a credential helper to lookup tokens
| * | chore: make lint happyKay-Uwe (Kiwi) Lorenz2021-03-071-13/+22
| | |
| * | fix: make secret helper more user friendlyKay-Uwe (Kiwi) Lorenz2021-03-071-11/+25
| | |
| * | fix: linting issues and testKay-Uwe (Kiwi) Lorenz2021-03-061-0/+4
| | |
| * | chore: add testKay-Uwe (Kiwi) Lorenz2021-03-061-0/+11
| | |
* | | Merge pull request #1375 from JohnVillalovos/jlvillal/update_uses_postNejc Habjan2021-04-171-1/+25
|\ \ \ | | | | | | | | chore: remove usage of getattr()
| * | | chore: remove usage of getattr()John L. Villalovos2021-03-151-1/+25
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | Remove usage of getattr(self, "_update_uses_post", False) Instead add it to class and set default value to False. Add a tests that shows it is set to True for the ProjectMergeRequestApprovalManager and ProjectApprovalManager classes.
* | | Merge pull request #1366 from JohnVillalovos/jlvillal/create_attrsNejc Habjan2021-04-171-10/+22
|\ \ \ | | | | | | | | chore: have _create_attrs & _update_attrs be a namedtuple
| * | | chore: have _create_attrs & _update_attrs be a namedtupleJohn L. Villalovos2021-04-171-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | Convert _create_attrs and _update_attrs to use a NamedTuple (RequiredOptional) to help with code readability. Update all code to use the NamedTuple.
* | | | Merge pull request #1363 from python-gitlab/feat/all-audit-eventsMax Wittig2021-03-241-7/+37
|\ \ \ \ | |_|/ / |/| | | Feat: cover all audit events
| * | | feat(objects): add support for group audit events APIfeat/all-audit-eventsNejc Habjan2021-03-071-3/+20
| | | |
| * | | test(objects): add unit test for instance audit eventsNejc Habjan2021-03-071-5/+18
| | | |
* | | | Merge pull request #1373 from JacobHenner/jacobhenner/add-package_filesNejc Habjan2021-03-141-1/+69
|\ \ \ \ | |_|/ / |/| | | feat: add support for Project Package Files
| * | | chore: fix package file test namingNejc Habjan2021-03-141-1/+1
| | | |
| * | | feat: add ProjectPackageFileJacob Henner2021-03-101-1/+69
| |/ / | | | | | | | | | | | | | | | | | | Add ProjectPackageFile and the ability to list project package package_files. Fixes #1372
* | | chore: add _create_attrs & _update_attrs to RESTManagerJohn L. Villalovos2021-03-101-42/+0
|/ / | | | | | | | | | | | | Add the attributes: _create_attrs and _update_attrs to the RESTManager class. This is so that we stop using getattr() if we don't need to. This also helps with type-hints being available for these attributes.
* | fix: handle tags like debian/2%2.6-21 as identifiersEmanuele Aina2021-03-051-0/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Git refnames are relatively free-form and can contain all sort for special characters, not just `/` and `#`, see http://git-scm.com/docs/git-check-ref-format In particular, Debian's DEP-14 standard for storing packaging in git repositories mandates the use of the `%` character in tags in some cases like `debian/2%2.6-21`. Unfortunately python-gitlab currently only escapes `/` to `%2F` and in some cases `#` to `%23`. This means that when using the commit API to retrieve information about the `debian/2%2.6-21` tag only the slash is escaped before being inserted in the URL path and the `%` is left untouched, resulting in something like `/api/v4/projects/123/repository/commits/debian%2F2%2.6-21`. When urllib3 seees that it detects the invalid `%` escape and then urlencodes the whole string, resulting in `/api/v4/projects/123/repository/commits/debian%252F2%252.6-21`, where the original `/` got escaped twice and produced `%252F`. To avoid the issue, fully urlencode identifiers and parameters to avoid the urllib3 auto-escaping in all cases. Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
* feat(users): add follow/unfollow APIfeat/user-follow-apiMax Wittig2021-02-271-0/+80
|
* test: don't add duplicate fixtureMax Wittig2021-02-241-26/+0
| | | Co-authored-by: Nejc Habjan <hab.nejc@gmail.com>
* feat(projects): add project access token apiMax Wittig2021-02-241-0/+139
|
* feat(objects): add Release Links API supportNejc Habjan2021-02-212-0/+141
|
* Merge pull request #1308 from Sineaggi/add-project-audit-endpointNejc Habjan2021-02-201-0/+79
|\ | | | | feat: add project audit endpoint
| * chore(tests): remove unused URL segmentNejc Habjan2021-02-201-2/+2
| |
| * feat: add project audit endpointClayton Walker2021-02-191-0/+79
| |
* | refactor: move Gitlab and GitlabList to gitlab/client.pyJohn L. Villalovos2021-02-181-0/+1
|/ | | | | | | | Move the classes Gitlab and GitlabList from gitlab/__init__.py to the newly created gitlab/client.py file. Update one test case that was depending on requests being defined in gitlab/__init__.py
* feat: add personal access token APIfeat/personal-access-token-apiMax Wittig2021-02-171-0/+46
| | | | See: https://docs.gitlab.com/ee/api/personal_access_tokens.html