Skip to content

Commit

Permalink
Merge pull request #1343 from JohnVillalovos/jlvillal/mypy_testing_th…
Browse files Browse the repository at this point in the history
…ings

chore: add and fix some type-hints in gitlab/client.py
  • Loading branch information
nejch committed Feb 28, 2021
2 parents 7441455 + 8837207 commit f5a65f0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gitlab/client.py
Expand Up @@ -623,7 +623,7 @@ def http_list(
query_data: Optional[Dict[str, Any]] = None,
as_list=None,
**kwargs,
):
) -> Union["GitlabList", List[Dict[str, Any]]]:
"""Make a GET request to the Gitlab server for list-oriented queries.
Args:
Expand Down Expand Up @@ -772,7 +772,9 @@ def http_delete(self, path: str, **kwargs) -> requests.Response:
return self.http_request("delete", path, **kwargs)

@gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabSearchError)
def search(self, scope: str, search: str, **kwargs) -> requests.Response:
def search(
self, scope: str, search: str, **kwargs
) -> Union["GitlabList", List[Dict[str, Any]]]:
"""Search GitLab resources matching the provided string.'
Args:
Expand Down Expand Up @@ -896,10 +898,10 @@ def __len__(self) -> int:
return 0
return int(self._total)

def __next__(self):
def __next__(self) -> Dict[str, Any]:
return self.next()

def next(self) -> "Gitlab":
def next(self) -> Dict[str, Any]:
try:
item = self._data[self._current]
self._current += 1
Expand Down

0 comments on commit f5a65f0

Please sign in to comment.