diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 325f213..0ece2a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,7 +60,6 @@ jobs: id: setup-uv with: enable-cache: true - cache-prefix: ${{ matrix.python-version }} - name: Install uv and set the python version uses: astral-sh/setup-uv@v5 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d85751c..eeace6a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,7 +34,6 @@ jobs: id: setup-uv with: enable-cache: true - cache-prefix: ${{ matrix.python-version }} - name: Install uv and set the python version uses: astral-sh/setup-uv@v5 diff --git a/magicalapi/types/resume_parser.py b/magicalapi/types/resume_parser.py index 0c7ca94..ccf32b1 100644 --- a/magicalapi/types/resume_parser.py +++ b/magicalapi/types/resume_parser.py @@ -33,6 +33,7 @@ class Basic(BaseModelValidated, OptionalModel): university: str graduation_year: str majors: str + birthday: str class ProjectExperience(BaseModelValidated, OptionalModel): title: str | None @@ -63,6 +64,10 @@ class Skill(BaseModelValidated, OptionalModel): name: str +class Intereset(BaseModelValidated, OptionalModel): + name: str + + class ResumeParser(BaseModelValidated): basic: Resume.Basic summary: str | None @@ -72,6 +77,7 @@ class ResumeParser(BaseModelValidated): certifications: list[Resume.Certification] languages: list[Resume.Language] skills: list[Resume.Skill] + interests: list[Intereset] class ResumeParserResponse(BaseResponse): diff --git a/tests/conftest.py b/tests/conftest.py index 5514a01..0beaf6f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -27,6 +27,7 @@ def resume_data(): "university": fake.company(), "graduation_year": fake.date_object().strftime("%m/%Y"), "majors": fake.text(max_nb_chars=50), + "birthday": fake.text(max_nb_chars=50), }, "summary": fake.text(), "project_experiences": [{"title": fake.text(), "description": fake.text()}], @@ -72,6 +73,7 @@ def resume_data(): "skills": [ {"name": "Python"}, ], + "interests": [{"name": fake.text()} for _ in range(randint(1, 5))], } yield resume_parser_data diff --git a/tests/services/test_base_service.py b/tests/services/test_base_service.py index 1ee8d81..05ec39e 100644 --- a/tests/services/test_base_service.py +++ b/tests/services/test_base_service.py @@ -1,3 +1,4 @@ +from collections.abc import AsyncGenerator import json from random import randint @@ -13,9 +14,18 @@ @pytest_asyncio.fixture(scope="function") -async def httpxclient(): +async def httpxclient(request) -> AsyncGenerator[httpx.AsyncClient]: + timeout = ( + request.param + if hasattr(request, "param") and isinstance(request.param, int | float) + else None + ) + # base url is empty - client = httpx.AsyncClient(headers={"content-type": "application/json"}, timeout=5) + client = httpx.AsyncClient( + headers={"content-type": "application/json"}, + timeout=timeout, + ) yield client @@ -51,6 +61,7 @@ async def test_base_service_get_request(httpxclient: httpx.AsyncClient): @pytest.mark.asyncio +@pytest.mark.parametrize("httpxclient", [4.0], indirect=True) async def test_base_service_request_timed_out(httpxclient: httpx.AsyncClient): base_service = BaseService(httpxclient) # change in fixture timeout @@ -58,11 +69,11 @@ async def test_base_service_request_timed_out(httpxclient: httpx.AsyncClient): # post request with pytest.raises(APIServerTimedout): await base_service._send_post_request( - path="https://httpbin.org/delay/6", data={} + path="https://httpbin.org/delay/10", data={} ) # gee request with pytest.raises(APIServerTimedout): - await base_service._send_get_request(path="https://httpbin.org/delay/6") + await base_service._send_get_request(path="https://httpbin.org/delay/10") def test_base_service_validating_response(httpxclient: httpx.AsyncClient):