summaryrefslogtreecommitdiff
path: root/tests/unit
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
|
* 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-131-52/+88
| | | | | | | | | | | 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.
* chore(api): temporarily remove topic delete endpointNejc Habjan2021-12-111-18/+0
| | | | It is not yet available upstream.
* feat(api): add support for Topics APINejc Habjan2021-12-111-0/+119
|
* 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-302-8/+9
| | | | | | | | | | 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.
* test(cli): improve basic CLI coveragetest/cli-coverageNejc Habjan2021-11-275-9/+24
|
* chore: create a 'tests/meta/' directory and put test_mro.py in itJohn L. Villalovos2021-11-151-122/+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-054-25/+16
|
* 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
* | 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
* | 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-1112-25/+25
|/ | | | | BREAKING CHANGE: As of python-gitlab 3.0.0, the default branch for development has changed from `master` to `main`.
* feat(objects): support Create and Revoke personal access token APINejc Habjan2021-09-131-21/+69
|
* 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 pipelines() methodNejc Habjan2021-09-081-11/+0
| | | | BREAKING CHANGE: remove deprecated pipelines() methods in favor of pipelines.list()
* feat: default to gitlab.com if no URL givenNejc Habjan2021-09-081-1/+44
| | | | | BREAKING CHANGE: python-gitlab will now default to gitlab.com if no URL is given
* Merge pull request #1486 from JohnVillalovos/jlvillal/prohibit_redirectionNejc Habjan2021-09-081-2/+89
|\ | | | | fix!: raise error if there is a 301/302 redirection
| * fix!: raise error if there is a 301/302 redirectionJohn L. Villalovos2021-09-081-2/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before we raised an error if there was a 301, 302 redirect but only from an http URL to an https URL. But we didn't raise an error for any other redirects. This caused two problems: 1. PUT requests that are redirected get changed to GET requests which don't perform the desired action but raise no error. This is because the GET response succeeds but since it wasn't a PUT it doesn't update. See issue: https://github.com/python-gitlab/python-gitlab/issues/1432 2. POST requests that are redirected also got changed to GET requests. They also caused hard to debug tracebacks for the user. See issue: https://github.com/python-gitlab/python-gitlab/issues/1477 Correct this by always raising a RedirectError exception and improve the exception message to let them know what was redirected. Closes: #1485 Closes: #1432 Closes: #1477
* | chore: convert to using type-annotations for managersJohn L. Villalovos2021-09-082-75/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Convert our manager usage to be done via type annotations. Now to define a manager to be used in a RESTObject subclass can simply do: class ExampleClass(CRUDMixin, RESTObject): my_manager: MyManager Any type-annotation that annotates it to be of type *Manager (with the exception of RESTManager) will cause the manager to be created on the object.
* | chore: improve type-hinting for managersJohn L. Villalovos2021-09-071-0/+74
|/ | | | | | | | | | | | | | | The 'managers' are dynamically created. This unfortunately means that we don't have any type-hints for them and so editors which understand type-hints won't know that they are valid attributes. * Add the type-hints for the managers we define. * Add a unit test that makes sure that the type-hints and the '_managers' attribute are kept in sync with each other. * Add unit test that makes sure specified managers in '_managers' have a name ending in 'Managers' to keep with current convention. * Make RESTObject._managers always present with a default value of None. * Fix a type-issue revealed now that mypy knows what the type is
* feat: allow global retry_transient_errors setupKarun Japhet2021-08-293-7/+173
| | | | | | `retry_transient_errors` can now be set through the Gitlab instance and global configuration Documentation for API usage has been updated and missing tests have been added.
* chore: fix mypy pre-commit hookNejc Habjan2021-08-221-0/+0
|
* Merge pull request #1533 from sugonyak/add-group-hooksNejc Habjan2021-06-272-31/+186
|\ | | | | feat(api): add group hooks
| * feat(api): add group hooksIvan Sugonyak2021-06-262-31/+186
| |
* | test(releases): add unit-tests for release updatePierre Paques2021-06-261-0/+39
|/
* feat(api): add MR pipeline manager in favor of pipelines() methodNejc Habjan2021-06-131-0/+64
|
* fix: catch invalid type used to initialize RESTObjectJohn L. Villalovos2021-06-101-0/+5
| | | | | | | | Sometimes we have errors where we don't get a dictionary passed to RESTObject.__init__() method. This breaks things but in confusing ways. Check in the __init__() method and raise an exception if it occurs.
* feat: add keys endpointBen Brown2021-06-031-0/+54
|
* feat(objects): add support for generic packages APINejc Habjan2021-05-311-1/+67
|
* feat(api): add deployment mergerequests interfaceLudwig Weiss2021-05-301-0/+56
|
* chore: apply suggestionsNejc Habjan2021-05-301-3/+7
|
* feat(objects): support all issues statistics endpointsNejc Habjan2021-05-301-3/+22
|
* feat(objects): add support for descendant groups APINejc Habjan2021-05-291-0/+58
|
* feat(objects): add pipeline test report supportRaphaël Monat2021-05-291-1/+53
|
* chore: move 'gitlab/tests/' dir to 'tests/unit/'John L. Villalovos2021-05-2655-0/+5852
Move the 'gitlab/tests/' directory to 'tests/unit/' so we have all the tests located under the 'tests/' directory.