diff --git a/setup.cfg b/setup.cfg index 9233e70..85fca31 100644 --- a/setup.cfg +++ b/setup.cfg @@ -48,5 +48,5 @@ exclude = traveltimepy/TimeFilterFastResponse_pb2.py [mypy] -exclude = ^(traveltimepy/TimeFilterFastRequest_pb2.py|traveltimepy/TimeFilterFastResponse_pb2.py)$ +exclude = ^(build/|venv/|traveltimepy/TimeFilterFastRequest_pb2.py|traveltimepy/TimeFilterFastResponse_pb2.py)$ diff --git a/tests/routes_test.py b/tests/routes_test.py index 17d9325..e58a9c5 100644 --- a/tests/routes_test.py +++ b/tests/routes_test.py @@ -65,5 +65,6 @@ async def test_snap_penalty(sdk: TravelTimeSdk): traveltime_without_penalty = ( result_without_penalty[0].locations[0].properties[0].travel_time ) - + assert traveltime_with_penalty is not None + assert traveltime_without_penalty is not None assert traveltime_with_penalty > traveltime_without_penalty diff --git a/traveltimepy/dto/requests/time_map_geojson.py b/traveltimepy/dto/requests/time_map_geojson.py index 9a0c06a..5830514 100644 --- a/traveltimepy/dto/requests/time_map_geojson.py +++ b/traveltimepy/dto/requests/time_map_geojson.py @@ -3,7 +3,6 @@ from geojson_pydantic import FeatureCollection from traveltimepy.dto.requests.request import TravelTimeRequest from traveltimepy.dto.requests.time_map import ( - TimeMapRequest, DepartureSearch, ArrivalSearch, ) @@ -16,7 +15,7 @@ class TimeMapRequestGeojson(TravelTimeRequest[FeatureCollection]): def split_searches(self, window_size: int) -> List[TravelTimeRequest]: return [ - TimeMapRequest( + TimeMapRequestGeojson( departure_searches=departures, arrival_searches=arrivals, ) diff --git a/traveltimepy/http.py b/traveltimepy/http.py index 3dc815e..19dca1b 100644 --- a/traveltimepy/http.py +++ b/traveltimepy/http.py @@ -1,7 +1,7 @@ import asyncio import json from dataclasses import dataclass -from typing import TypeVar, Type, Dict +from typing import TypeVar, Type, Dict, Optional from aiohttp import ClientSession, ClientResponse, TCPConnector, ClientTimeout from pydantic import BaseModel @@ -88,7 +88,7 @@ async def send_get_async( path: str, headers: Dict[str, str], sdk_params: SdkParams, - params: Dict[str, str], + params: Optional[Dict[str, str]], ) -> T: async with ClientSession( timeout=ClientTimeout(total=sdk_params.timeout), diff --git a/traveltimepy/sdk.py b/traveltimepy/sdk.py index b026cbf..07f1a8a 100644 --- a/traveltimepy/sdk.py +++ b/traveltimepy/sdk.py @@ -155,6 +155,7 @@ async def map_info_async(self) -> List[Map]: "map-info", self._headers(AcceptType.JSON), self._sdk_params, + None, ) return res.maps