Skip to content

Commit

Permalink
Merge pull request #1829 from python-gitlab/jlvillal/lazy_service
Browse files Browse the repository at this point in the history
fix(api): services: add missing `lazy` parameter
  • Loading branch information
nejch committed Jan 13, 2022
2 parents 4a000b6 + 888f332 commit 824151c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
10 changes: 9 additions & 1 deletion 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
Expand Down Expand Up @@ -275,7 +280,10 @@ def get(
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

Expand Down
11 changes: 11 additions & 0 deletions 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)

0 comments on commit 824151c

Please sign in to comment.