diff --git a/ba.code-workspace b/ba.code-workspace deleted file mode 100644 index 54c5b43..0000000 --- a/ba.code-workspace +++ /dev/null @@ -1,25 +0,0 @@ -{ - "folders": [ - { - "path": "." - } - ], - "settings": { - "editor.formatOnSave": true, - "python.formatting.provider": "black", - "editor.defaultFormatter": "ms-python.black-formatter", - "python.testing.autoTestDiscoverOnSaveEnabled": false, - "python.testing.pytestEnabled": true, - "python.linting.mypyEnabled": true, - "python.linting.mypyPath": ".venv/bin/dmypy", - "python.linting.mypyArgs": ["run", "--"], - "python.linting.enabled": true, - "python.linting.flake8Enabled": true, - "python.linting.pylintEnabled": false, - "[python]": { - "editor.codeActionsOnSave": { - "source.organizeImports": "explicit" - } - } - } -} diff --git a/blocket_api/blocket.py b/blocket_api/blocket.py index 7fcbc31..15ce067 100644 --- a/blocket_api/blocket.py +++ b/blocket_api/blocket.py @@ -88,6 +88,8 @@ def search_car( milage_to: int | None = None, colors: list[CarColor] = [], transmissions: list[CarTransmission] = [], + horsepower_from: int | None = None, + horsepower_to: int | None = None, org_id: int | None = None, ) -> dict[str, Any]: url = f"{SITE_URL}/mobility/search/api/search/SEARCH_ID_CAR_USED" @@ -102,12 +104,13 @@ def search_car( "year_to": year_to, "milage_from": milage_from, "milage_to": milage_to, + "engine_effect_from": horsepower_from, + "engine_effect_to": horsepower_to, "orgId": org_id, } params = [QueryParam(k, v) for k, v in param_dict.items() if v is not None] - # Multi-value params params.extend(QueryParam("location", loc.value) for loc in locations) params.extend(QueryParam("make", model.value) for model in models) params.extend(QueryParam("exterior_colour", color.value) for color in colors) diff --git a/tests/requests.py b/tests/requests.py index f82865c..c8c2f6a 100644 --- a/tests/requests.py +++ b/tests/requests.py @@ -123,6 +123,8 @@ def test_search_car(self) -> None: "&price_from=1000" "&price_to=50000" "&transmission=2" + "&engine_effect_from=200" + "&engine_effect_to=300" "&orgId=1337" ) respx.get(expected_url).mock( @@ -134,6 +136,8 @@ def test_search_car(self) -> None: price_from=1000, price_to=50000, transmissions=[CarTransmission.AUTOMATIC], + horsepower_from=200, + horsepower_to=300, org_id=1337, ) assert result == {"status": "ok"} @@ -303,7 +307,7 @@ def test_get_mc_ad(self) -> None:
150 cc
-