From 46f87756a646ac5d387f86e3cd171bd9f7ac74fb Mon Sep 17 00:00:00 2001 From: Pablo Moreno Date: Wed, 26 May 2021 09:17:27 +0200 Subject: [PATCH] Blacked --- spook/resources.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/spook/resources.py b/spook/resources.py index 02a012d..834644d 100644 --- a/spook/resources.py +++ b/spook/resources.py @@ -85,7 +85,10 @@ def get_response_data(self, response) -> Union[dict, str]: return response_data def map_response( - self, data: Union[str, dict, list], action: str = 'get', status: int = 200, + self, + data: Union[str, dict, list], + action: str = "get", + status: int = 200, ) -> Union[str, dict, list]: """ Maps the response to a custom format @@ -123,7 +126,7 @@ def get(self, url: str, **params) -> APIResourceResponse: """ response = self.http.get(url, headers=self.get_headers(), params=params) data = self.get_response_data(response) - data = self.map_response(data, action='get', status=response.status_code) + data = self.map_response(data, action="get", status=response.status_code) return APIResourceResponse(data=data, status=response.status_code) @@ -205,7 +208,9 @@ def patch(self, pk: Any, data: dict, query: dict = None) -> APIResourceResponse: self.get_url(pk), json=data, headers=self.get_headers(), params=query ) data = self.get_response_data(response) - data = self.map_response(data, action="partial_update", status=response.status_code) + data = self.map_response( + data, action="partial_update", status=response.status_code + ) return APIResourceResponse(data=data, status=response.status_code)