add resume

This commit is contained in:
ivankirpichnikov
2025-11-22 02:17:18 +03:00
parent a207e5a217
commit d9a3c39980
33 changed files with 1157 additions and 97 deletions
+33 -6
View File
@@ -1,6 +1,12 @@
from typing import Any
from httpx import AsyncClient, Response
def make_auth_headers(access_token: str | None) -> dict[str, Any]:
return {} if access_token is None else {"Authorization": f"Bearer {access_token}"}
class TestApiGateway:
def __init__(self, client: AsyncClient) -> None:
self._client = client
@@ -18,11 +24,9 @@ class TestApiGateway:
)
async def get_profile(self, access_token: str | None) -> Response:
headers = {} if access_token is None else {"Authorization": f"Bearer {access_token}"}
return await self._client.get(
"/profile",
headers=headers,
headers=make_auth_headers(access_token),
)
async def patch_profile(
@@ -34,8 +38,6 @@ class TestApiGateway:
avatar_url: str | None = None,
phone: str | None = None,
) -> Response:
headers = {} if access_token is None else {"Authorization": f"Bearer {access_token}"}
return await self._client.patch(
"/profile",
json={
@@ -49,5 +51,30 @@ class TestApiGateway:
}.items()
if value is not None
},
headers=headers,
headers=make_auth_headers(access_token),
)
async def create_resume(
self,
access_token: str,
position: str,
about_me: str,
key_skills: list[str],
experience_type: str,
) -> Response:
return await self._client.post(
"/resume",
json={
"position": position,
"about_me": about_me,
"key_skills": key_skills,
"experience_type": experience_type,
},
headers=make_auth_headers(access_token),
)
async def get_resume(self, access_token: str, resume_id: str) -> Response:
return await self._client.get(
f"/resume/{resume_id}",
headers=make_auth_headers(access_token),
)