|
3 | 3 | import codecs
|
4 | 4 | import datetime
|
5 | 5 | import unittest
|
| 6 | +import pytest |
6 | 7 |
|
7 | 8 | import responses
|
8 | 9 |
|
@@ -1095,7 +1096,7 @@ def test_route_v8_success(self):
|
1095 | 1096 | lang="tr-TR",
|
1096 | 1097 | return_fields=[herepy.RoutingApiReturnField.polyline],
|
1097 | 1098 | span_fields=[herepy.RoutingApiSpanField.walkAttributes],
|
1098 |
| - truck={"shippedHazardousGoods": ["explosive", "gas"]}, |
| 1099 | + vehicle={"shippedHazardousGoods": ["explosive", "gas"]}, |
1099 | 1100 | scooter={"allowHighway": "true"},
|
1100 | 1101 | )
|
1101 | 1102 | self.assertTrue(response)
|
@@ -1129,7 +1130,7 @@ def test_route_v8_error_invalid_credentials(self):
|
1129 | 1130 | lang="tr-TR",
|
1130 | 1131 | return_fields=[herepy.RoutingApiReturnField.polyline],
|
1131 | 1132 | span_fields=[herepy.RoutingApiSpanField.walkAttributes],
|
1132 |
| - truck={"shippedHazardousGoods": ["explosive", "gas"]}, |
| 1133 | + vehicle={"shippedHazardousGoods": ["explosive", "gas"]}, |
1133 | 1134 | scooter={"allowHighway": "true"},
|
1134 | 1135 | )
|
1135 | 1136 |
|
@@ -1190,7 +1191,7 @@ def test_route_v8_error_access_denied(self):
|
1190 | 1191 | lang="tr-TR",
|
1191 | 1192 | return_fields=[herepy.RoutingApiReturnField.polyline],
|
1192 | 1193 | span_fields=[herepy.RoutingApiSpanField.walkAttributes],
|
1193 |
| - truck={"shippedHazardousGoods": ["explosive", "gas"]}, |
| 1194 | + vehicle={"shippedHazardousGoods": ["explosive", "gas"]}, |
1194 | 1195 | scooter={"allowHighway": "true"},
|
1195 | 1196 | )
|
1196 | 1197 |
|
@@ -1225,12 +1226,34 @@ def test_route_v8_url_parameters_multiple(self):
|
1225 | 1226 | status=200,
|
1226 | 1227 | match=[
|
1227 | 1228 | responses.matchers.query_param_matcher(
|
1228 |
| - {"truck[height]": "15000", "truck[width]": "3000"}, strict_match=False |
| 1229 | + {"vehicle[height]": "15000", "vehicle[width]": "3000"}, strict_match=False |
1229 | 1230 | )
|
1230 | 1231 | ],
|
1231 | 1232 | )
|
1232 | 1233 | self._api.route_v8(transport_mode=herepy.RoutingTransportMode.truck,
|
1233 | 1234 | origin=[41.9798, -87.8801],
|
1234 | 1235 | destination=[41.9043, -87.9216],
|
1235 |
| - truck={"height": ["15000"], "width": ["3000"]} |
| 1236 | + vehicle={"height": ["15000"], "width": ["3000"]} |
| 1237 | + ) |
| 1238 | + |
| 1239 | + @responses.activate |
| 1240 | + @pytest.mark.filterwarnings("ignore:'truck' parameter is deprecated") |
| 1241 | + def test_route_v8_truck_parameter_deprecated(self): |
| 1242 | + responses.add( |
| 1243 | + responses.GET, |
| 1244 | + "https://router.hereapi.com/v8/routes", |
| 1245 | + "{}", |
| 1246 | + status=200, |
| 1247 | + match=[ |
| 1248 | + responses.matchers.query_param_matcher( |
| 1249 | + {"vehicle[height]": "15000", "vehicle[width]": "3000"}, |
| 1250 | + strict_match=False, |
| 1251 | + ) |
| 1252 | + ], |
| 1253 | + ) |
| 1254 | + self._api.route_v8( |
| 1255 | + transport_mode=herepy.RoutingTransportMode.truck, |
| 1256 | + origin=[41.9798, -87.8801], |
| 1257 | + destination=[41.9043, -87.9216], |
| 1258 | + truck={"height": ["15000"], "width": ["3000"]}, |
1236 | 1259 | )
|
0 commit comments