diff options
author | John L. Villalovos <john@sodarock.com> | 2021-11-07 14:33:39 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-11-15 14:31:12 -0800 |
commit | 46773a82565cef231dc3391c12f296ac307cb95c (patch) | |
tree | 32cc9473ec28cc3d10be3baff28a74e8a17ac718 /gitlab/v4/objects/deployments.py | |
parent | 94feb8a5534d43a464b717275846faa75783427e (diff) | |
download | gitlab-46773a82565cef231dc3391c12f296ac307cb95c.tar.gz |
chore: ensure get() methods have correct type-hintsjlvillal/mypy_ensure_type_hints
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.
Diffstat (limited to 'gitlab/v4/objects/deployments.py')
-rw-r--r-- | gitlab/v4/objects/deployments.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gitlab/v4/objects/deployments.py b/gitlab/v4/objects/deployments.py index 8b4a7be..9aee699 100644 --- a/gitlab/v4/objects/deployments.py +++ b/gitlab/v4/objects/deployments.py @@ -1,3 +1,5 @@ +from typing import Any, cast, Union + from gitlab.base import RequiredOptional, RESTManager, RESTObject from gitlab.mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin @@ -28,3 +30,8 @@ class ProjectDeploymentManager(RetrieveMixin, CreateMixin, UpdateMixin, RESTMana _create_attrs = RequiredOptional( required=("sha", "ref", "tag", "status", "environment") ) + + def get( + self, id: Union[str, int], lazy: bool = False, **kwargs: Any + ) -> ProjectDeployment: + return cast(ProjectDeployment, super().get(id=id, lazy=lazy, **kwargs)) |