Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arnasbr committed Oct 21, 2024
1 parent ea948b0 commit cc43af9
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions tests/time_map_fast_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import pytest

from traveltimepy import Transportation, TravelTimeSdk
from traveltimepy.dto.common import Coordinates


@pytest.mark.asyncio
async def test_one_to_many(sdk: TravelTimeSdk):
results = await sdk.time_map_fast_async(
coordinates=[
Coordinates(lat=51.507609, lng=-0.128315),
Coordinates(lat=51.517609, lng=-0.138315),
],
travel_time=900,
transportation=Transportation(type="public_transport"),
)

assert len(results) > 0


@pytest.mark.asyncio
async def test_many_to_one(sdk: TravelTimeSdk):
results = await sdk.time_map_fast_async(
coordinates=[
Coordinates(lat=51.507609, lng=-0.128315),
Coordinates(lat=51.517609, lng=-0.138315),
],
travel_time=900,
transportation=Transportation(type="public_transport"),
one_to_many=False,
)

assert len(results) > 0


@pytest.mark.asyncio
async def test_one_to_many_geojson(sdk: TravelTimeSdk):
results = await sdk.time_map_fast_geojson_async(
coordinates=[
Coordinates(lat=51.507609, lng=-0.128315),
Coordinates(lat=51.517609, lng=-0.138315),
],
travel_time=900,
transportation=Transportation(type="public_transport"),
)

assert len(results) > 0


@pytest.mark.asyncio
async def test_many_to_one_geojson(sdk: TravelTimeSdk):
results = await sdk.time_map_fast_geojson_async(
coordinates=[
Coordinates(lat=51.507609, lng=-0.128315),
Coordinates(lat=51.517609, lng=-0.138315),
],
travel_time=900,
transportation=Transportation(type="public_transport"),
one_to_many=False,
)

assert len(results) > 0

0 comments on commit cc43af9

Please sign in to comment.