[#310] Added classmethod decorator in Http client

Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
Dmitriy Zayakin 2024-11-14 15:01:26 +03:00
parent f24bfc06fd
commit 4677709d13

View file

@ -50,6 +50,7 @@ class HttpClient:
return response
@classmethod
def _attach_response(self, response: httpx.Response):
request = response.request
@ -88,6 +89,7 @@ class HttpClient:
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:
headers = " ".join(f'-H "{name.title()}: {value}"' for name, value in headers.items())
data = f" -d '{data}'" if data else ""