|
| 1 | +from aiohttp import web |
| 2 | + |
| 3 | + |
| 4 | +async def test_snap_to_roads(aresponses, client): |
| 5 | + aresponses.add( |
| 6 | + 'roads.googleapis.com', |
| 7 | + '/v1/snapToRoads', |
| 8 | + 'get', |
| 9 | + aresponses.Response( |
| 10 | + body='{"status": "OK", "snappedPoints": ["foo"]}', |
| 11 | + status=web.HTTPOk.status_code, |
| 12 | + content_type='application/json', |
| 13 | + ), |
| 14 | + ) |
| 15 | + |
| 16 | + resp = await client.snap_to_roads('') |
| 17 | + assert resp == ['foo'] |
| 18 | + |
| 19 | + |
| 20 | +async def test_nearest_roads(aresponses, client): |
| 21 | + aresponses.add( |
| 22 | + 'roads.googleapis.com', |
| 23 | + '/v1/nearestRoads', |
| 24 | + 'get', |
| 25 | + aresponses.Response( |
| 26 | + body='{"status": "OK", "snappedPoints": ["foo"]}', |
| 27 | + status=web.HTTPOk.status_code, |
| 28 | + content_type='application/json', |
| 29 | + ), |
| 30 | + ) |
| 31 | + |
| 32 | + resp = await client.nearest_roads('') |
| 33 | + assert resp == ['foo'] |
| 34 | + |
| 35 | + |
| 36 | +async def test_speed_limits(aresponses, client): |
| 37 | + aresponses.add( |
| 38 | + 'roads.googleapis.com', |
| 39 | + '/v1/speedLimits', |
| 40 | + 'get', |
| 41 | + aresponses.Response( |
| 42 | + body='{"status": "OK", "speedLimits": ["foo"]}', |
| 43 | + status=web.HTTPOk.status_code, |
| 44 | + content_type='application/json', |
| 45 | + ), |
| 46 | + ) |
| 47 | + |
| 48 | + resp = await client.speed_limits('') |
| 49 | + assert resp == ["foo"] |
| 50 | + |
| 51 | + |
| 52 | +async def test_snapped_speed_limits(aresponses, client): |
| 53 | + aresponses.add( |
| 54 | + 'roads.googleapis.com', |
| 55 | + '/v1/speedLimits', |
| 56 | + 'get', |
| 57 | + aresponses.Response( |
| 58 | + body='{"status": "OK", "speedLimits": ["foo"]}', |
| 59 | + status=web.HTTPOk.status_code, |
| 60 | + content_type='application/json', |
| 61 | + ), |
| 62 | + ) |
| 63 | + |
| 64 | + resp = await client.snapped_speed_limits('') |
| 65 | + assert resp |
0 commit comments