From 7c08571ffb5017627ef8d899417985bb9b739154 Mon Sep 17 00:00:00 2001 From: Dmitriy Zayakin Date: Mon, 18 Nov 2024 16:51:58 +0300 Subject: [PATCH] [#322] Added classmethod decorator in Http client Signed-off-by: Dmitriy Zayakin --- src/frostfs_testlib/http/http_client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frostfs_testlib/http/http_client.py b/src/frostfs_testlib/http/http_client.py index 4d24cfb..3106273 100644 --- a/src/frostfs_testlib/http/http_client.py +++ b/src/frostfs_testlib/http/http_client.py @@ -51,7 +51,7 @@ class HttpClient: return response @classmethod - def _attach_response(self, response: httpx.Response): + def _attach_response(cls, response: httpx.Response): request = response.request try: @@ -84,13 +84,13 @@ class HttpClient: f"Response Headers: {response_headers}\n\n" f"Response Body: {response.text}\n\n" ) - curl_request = self._create_curl_request(request.url, request.method, request.headers, request_body) + curl_request = cls._create_curl_request(request.url, request.method, request.headers, request_body) reporter.attach(report, "Requests Info") reporter.attach(curl_request, "CURL") @classmethod - def _create_curl_request(self, url: str, method: str, headers: httpx.Headers, data: str) -> str: + def _create_curl_request(cls, url: str, method: str, headers: httpx.Headers, data: str) -> str: headers = " ".join(f'-H "{name.title()}: {value}"' for name, value in headers.items()) data = f" -d '{data}'" if data else "" # Option -k means no verify SSL