summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* test: reproduce missing pagination headers in teststest/missing-pagination-headersNejc Habjan2021-12-301-0/+30
|
* test: drop httmock dependency in test_gitlab.pyNejc Habjan2021-12-301-45/+61
|
* chore: ensure reset_gitlab() succeedsJohn L. Villalovos2021-12-281-0/+30
| | | | | | | | | Ensure reset_gitlab() succeeds by waiting to make sure everything has been deleted as expected. If the timeout is exceeded fail the test. Not using `wait_for_sidekiq` as it didn't work. During testing I didn't see any sidekiq processes as being busy even though not everything was deleted.
* Merge pull request #1782 from python-gitlab/jlvillal/repository_func_testsNejc Habjan2021-12-281-0/+4
|\ | | | | chore: skip a functional test if not using >= py3.9
| * chore: skip a functional test if not using >= py3.9jlvillal/repository_func_testsJohn L. Villalovos2021-12-261-0/+4
| | | | | | | | | | One of the tests requires Python 3.9 or higher to run. Mark the test to be skipped if running Python less than 3.9.
* | chore: update version in docker-compose.ymljlvillal/docker_composeJohn L. Villalovos2021-12-261-1/+1
|/ | | | | | | | | | | When running with docker-compose on Ubuntu 20.04 I got the error: $ docker-compose up ERROR: The Compose file './docker-compose.yml' is invalid because: networks.gitlab-network value Additional properties are not allowed ('name' was unexpected) Changing the version in the docker-compose.yml file fro '3' to '3.5' resolved the issue.
* feat(api): support file format for repository archiveMax Ludwig2021-12-211-2/+25
|
* fix: stop encoding '.' to '%2E'jlvillal/leave_dotJohn L. Villalovos2021-12-204-24/+8
| | | | | | | | | | | | | | | | | | | | Forcing the encoding of '.' to '%2E' causes issues. It also goes against the RFC: https://datatracker.ietf.org/doc/html/rfc3986.html#section-2.3 From the RFC: For consistency, percent-encoded octets in the ranges of ALPHA (%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should not be created by URI producers... Closes #1006 Related #1356 Related #1561 BREAKING CHANGE: stop encoding '.' to '%2E'. This could potentially be a breaking change for users who have incorrectly configured GitLab servers which don't handle period '.' characters correctly.
* chore: fix unit test if config file exists locallyjlvillal/unit_test_configJohn L. Villalovos2021-12-191-2/+4
| | | | Closes #1764
* feat(cli): do not require config file to run CLIfeat/cli-without-config-fileNejc Habjan2021-12-132-52/+127
| | | | | | | | | | | BREAKING CHANGE: A config file is no longer needed to run the CLI. python-gitlab will default to https://gitlab.com with no authentication if there is no config file provided. python-gitlab will now also only look for configuration in the provided PYTHON_GITLAB_CFG path, instead of merging it with user- and system-wide config files. If the environment variable is defined and the file cannot be opened, python-gitlab will now explicitly fail.
* test(api): fix current user mail count in newer gitlabNejc Habjan2021-12-111-2/+2
|
* chore(api): temporarily remove topic delete endpointNejc Habjan2021-12-113-23/+0
| | | | It is not yet available upstream.
* feat(api): add support for Topics APINejc Habjan2021-12-114-1/+143
|
* Merge pull request #1710 from python-gitlab/jlvillal/get_without_idNejc Habjan2021-12-111-19/+84
|\ | | | | chore: add get() methods for GetWithoutIdMixin based classes
| * chore: add get() methods for GetWithoutIdMixin based classesjlvillal/get_without_idJohn L. Villalovos2021-12-081-19/+84
| | | | | | | | | | | | | | Add the get() methods for the GetWithoutIdMixin based classes. Update the tests/meta/test_ensure_type_hints.py tests to check to ensure that the get methods are defined with the correct return type.
* | feat: add delete on package_file objectSimon Hébert-Deschamps2021-12-091-1/+34
|/
* chore: add running unit tests on windows/macosJohn L. Villalovos2021-12-071-0/+2
| | | | | Add running the unit tests on windows-latest and macos-latest with Python 3.10.
* Merge pull request #1702 from python-gitlab/jlvillal/attribute_helpNejc Habjan2021-12-011-0/+24
|\ | | | | chore: attempt to be more informative for missing attributes
| * chore: attempt to be more informative for missing attributesjlvillal/attribute_helpJohn L. Villalovos2021-11-301-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A commonly reported issue from users on Gitter is that they get an AttributeError for an attribute that should be present. This is often caused due to the fact that they used the `list()` method to retrieve the object and objects retrieved this way often only have a subset of the full data. Add more details in the AttributeError message that explains the situation to users. This will hopefully allow them to resolve the issue. Update the FAQ in the docs to add a section discussing the issue. Closes #1138
* | chore: use constants from gitlab.const moduleJohn L. Villalovos2021-11-304-11/+12
| | | | | | | | | | 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.
* chore(tests): apply review suggestionsNejc Habjan2021-11-281-3/+3
|
* test(cli): improve basic CLI coveragetest/cli-coverageNejc Habjan2021-11-2711-28/+98
|
* feat: add support for `projects.groups.list()`jlvillal/project_groupsJohn L. Villalovos2021-11-261-0/+18
| | | | | | Add support for `projects.groups.list()` endpoint. Closes #1717
* chore: remove duplicate/no-op tests from meta/test_ensure_type_hintsJohn L. Villalovos2021-11-241-21/+7
| | | | | | | | | | | | | | | | | | | | | | | Before we were generating 725 tests for the meta/test_ensure_type_hints.py tests. Which isn't a huge concern as it was fairly fast. But when we had a failure we would usually get two failures for each problem as the same test was being run multiple times. Changed it so that: 1. Don't add tests that are not for *Manager classes 2. Use a set so that we don't have duplicate tests. After doing that our generated test count in meta/test_ensure_type_hints.py went from 725 to 178 tests. Additionally removed the parsing of `pyproject.toml` to generate files to ignore as we have finished adding type-hints to all files in gitlab/v4/objects/. This also means we no longer use the toml library so remove installation of `types-toml`. To determine the test count the following command was run: $ tox -e py39 -- -k test_ensure_type_hints
* Merge pull request #1693 from python-gitlab/jlvillay/mypy_test_metaNejc Habjan2021-11-232-5/+6
|\ | | | | chore: enable mypy for tests/meta/*
| * chore: enable mypy for tests/meta/*jlvillay/mypy_test_metaJohn L. Villalovos2021-11-162-5/+6
| |
* | chore: correct test_groups.py testjlvillal/func_testJohn L. Villalovos2021-11-191-0/+4
|/ | | | | | | | | The test was checking twice if the same group3 was not in the returned list. Should have been checking for group3 and group4. Also added a test that only skipped one group and checked that the group was not in the returned list and a non-skipped group was in the list.
* chore: ensure get() methods have correct type-hintsjlvillal/mypy_ensure_type_hintsJohn L. Villalovos2021-11-151-0/+85
| | | | | | | | Fix classes which don't have correct 'get()' methods for classes derived from GetMixin. Add a unit test which verifies that classes have the correct return type in their 'get()' method.
* chore: create a 'tests/meta/' directory and put test_mro.py in itJohn L. Villalovos2021-11-152-0/+0
| | | | | The 'test_mro.py' file is not really a unit test but more of a 'meta' check on the validity of the code base.
* refactor: use new-style formatting for named placeholdersNejc Habjan2021-11-081-1/+1
|
* refactor: use f-strings for string formattingNejc Habjan2021-11-059-33/+22
|
* Merge pull request #1646 from JacobHenner/add-merge-trainsNejc Habjan2021-11-011-0/+65
|\ | | | | feat(api): add merge trains
| * feat(api): add merge trainsJacob Henner2021-10-201-0/+65
| | | | | | | | Add support for merge trains
* | fix(build): do not include docs in wheel packageNejc Habjan2021-10-311-4/+5
| |
* | feat(api): add project milestone promotionRaimund Hook2021-10-271-0/+21
| | | | | | | | | | | | Adds promotion to Project Milestones Signed-off-by: Raimund Hook <raimund.hook@exfo.com>
* | Merge pull request #1641 from JacobHenner/add-merge-request-approval-stateNejc Habjan2021-10-201-0/+31
|\ \ | | | | | | feat(api): add merge request approval state
| * | feat(api): add merge request approval stateJacob Henner2021-10-191-0/+31
| |/ | | | | | | Add support for merge request approval state
* | feat(api): add project label promotionRaimund Hook2021-10-181-0/+24
| | | | | | | | | | | | Adds a mixin that allows the /promote endpoint to be called. Signed-off-by: Raimund Hook <raimund.hook@exfo.com>
* | fix(api): delete invalid 'project-runner get' command (#1628)Léo GATELLIER2021-10-171-13/+2
| | | | | | | | | | * fix(api): delete 'group-runner get' and 'group-runner delete' commands Co-authored-by: Léo GATELLIER <git@leogatellier.fr>
* | feat(objects): support delete package files APINejc Habjan2021-10-141-0/+18
| |
* | feat(objects): list starred projects of a userNejc Habjan2021-10-141-2/+25
| |
* | chore: rename `master` branch to `main`chore/master-to-mainNejc Habjan2021-10-1118-46/+46
|/ | | | | BREAKING CHANGE: As of python-gitlab 3.0.0, the default branch for development has changed from `master` to `main`.
* chore(deps): upgrade gitlab-ce to 14.3.2-ce.0Nejc Habjan2021-10-081-1/+1
|
* feat(objects): support Create and Revoke personal access token APINejc Habjan2021-09-131-21/+69
|
* refactor(objects): remove deprecated constants defined in objectsNejc Habjan2021-09-111-1/+1
| | | | | BREAKING CHANGE: remove deprecated constants defined in gitlab.v4.objects, and use only gitlab.const module
* refactor(objects): remove deprecated tag release APINejc Habjan2021-09-081-4/+0
| | | | | BREAKING CHANGE: remove deprecated tag release API. This was removed in GitLab 14.0
* refactor(objects): remove deprecated project.issuesstatisticsNejc Habjan2021-09-081-4/+0
| | | | | BREAKING CHANGE: remove deprecated project.issuesstatistics in favor of project.issues_statistics
* refactor(objects): remove deprecated members.all() methodNejc Habjan2021-09-081-1/+0
| | | | | BREAKING CHANGE: remove deprecated members.all() method in favor of members_all.list()
* refactor(objects): remove deprecated pipelines() methodNejc Habjan2021-09-081-11/+0
| | | | BREAKING CHANGE: remove deprecated pipelines() methods in favor of pipelines.list()