diff options
author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-01-13 17:38:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 17:38:08 +0100 |
commit | 824151ce9238f97118ec21aa8b3267cc7a2cd649 (patch) | |
tree | 3fe3268570dbe66f5d4e35bef46b4ca018c516da | |
parent | 4a000b6c41f0a7ef6121c62a4c598edc20973799 (diff) | |
parent | 888f3328d3b1c82a291efbdd9eb01f11dff0c764 (diff) | |
download | gitlab-824151ce9238f97118ec21aa8b3267cc7a2cd649.tar.gz |
Merge pull request #1829 from python-gitlab/jlvillal/lazy_service
fix(api): services: add missing `lazy` parameter
-rw-r--r-- | gitlab/v4/objects/services.py | 10 | ||||
-rw-r--r-- | tests/functional/api/test_services.py | 11 |
2 files changed, 20 insertions, 1 deletions
diff --git a/gitlab/v4/objects/services.py b/gitlab/v4/objects/services.py index 632f002..2af04d2 100644 --- a/gitlab/v4/objects/services.py +++ b/gitlab/v4/objects/services.py @@ -1,3 +1,8 @@ +""" +GitLab API: +https://docs.gitlab.com/ee/api/integrations.html +""" + from typing import Any, cast, Dict, List, Optional, Union from gitlab import cli @@ -275,7 +280,10 @@ class ProjectServiceManager(GetMixin, UpdateMixin, DeleteMixin, ListMixin, RESTM GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server cannot perform the request """ - obj = cast(ProjectService, super(ProjectServiceManager, self).get(id, **kwargs)) + obj = cast( + ProjectService, + super(ProjectServiceManager, self).get(id, lazy=lazy, **kwargs), + ) obj.id = id return obj diff --git a/tests/functional/api/test_services.py b/tests/functional/api/test_services.py new file mode 100644 index 0000000..100c0c9 --- /dev/null +++ b/tests/functional/api/test_services.py @@ -0,0 +1,11 @@ +""" +GitLab API: +https://docs.gitlab.com/ee/api/integrations.html +""" + +import gitlab + + +def test_services(project): + service = project.services.get("jira", lazy=True) + assert isinstance(service, gitlab.v4.objects.ProjectService) |