Skip to content

Commit 643c790

Browse files
author
Jakob Stolze
committed
test: update tests to not use InlineResponse classes
1 parent c8f343f commit 643c790

7 files changed

+12
-12
lines changed

test/test_directions_service_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_get_geo_json_route(self):
4343
)
4444
profile = 'driving-car'
4545
response = self.api.get_geo_json_route(body, profile)
46-
self.assertEqual(response.bbox, [8.681423, 49.414599, 8.690123, 49.420514])
46+
self.assertEqual(response["bbox"], [8.681423, 49.414599, 8.690123, 49.420514])
4747

4848
#def test_get_gpx_route(self):
4949
# """Test case for get_gpx_route

test/test_elevation_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ def test_elevation_line_post(self):
4343
geometry="u`rgFswjpAKD"
4444
)
4545
response = self.api.elevation_line_post(body)
46-
self.assertEqual(response.geometry.coordinates[0], [13.3313, 38.10843, 72.0])
46+
self.assertEqual(response["geometry"]["coordinates"][0], [13.3313, 38.10843, 72.0])
4747

4848
def test_elevation_point_get(self):
4949
"""Test case for elevation_point_get
5050
5151
Elevation Point Service # noqa: E501
5252
"""
5353
response = self.api.elevation_point_get(geometry=[13.331273, 38.10849])
54-
self.assertEqual(response.geometry.coordinates, [13.331273,38.10849,72])
54+
self.assertEqual(response["geometry"]["coordinates"], [13.331273,38.10849,72])
5555

5656
def test_elevation_point_post(self):
5757
"""Test case for elevation_point_post
@@ -64,7 +64,7 @@ def test_elevation_point_post(self):
6464
)
6565

6666
response = self.api.elevation_point_post(body)
67-
self.assertEqual(response.geometry.coordinates, [13.331273,38.10849,72])
67+
self.assertEqual(response["geometry"]["coordinates"], [13.331273,38.10849,72])
6868

6969

7070
if __name__ == '__main__':

test/test_geocode_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_geocode_autocomplete_get(self):
4141
text = "Toky"
4242
response = self.api.geocode_autocomplete_get(text)
4343
self.assertIsNotNone(response)
44-
self.assertEqual(len(response.features), 10)
44+
self.assertEqual(len(response["features"]), 10)
4545

4646
def test_geocode_reverse_get(self):
4747
"""Test case for geocode_reverse_get
@@ -52,7 +52,7 @@ def test_geocode_reverse_get(self):
5252
lat = 48.858268
5353
response = self.api.geocode_reverse_get(lon, lat)
5454
self.assertIsNotNone(response)
55-
self.assertEqual(len(response.features), 10)
55+
self.assertEqual(len(response["features"]), 10)
5656

5757
def test_geocode_search_get(self):
5858
"""Test case for geocode_search_get
@@ -62,7 +62,7 @@ def test_geocode_search_get(self):
6262
text = "Namibian Brewery"
6363
response = self.api.geocode_search_get(text)
6464
self.assertIsNotNone(response)
65-
self.assertEqual(len(response.features), 10)
65+
self.assertEqual(len(response["features"]), 10)
6666

6767
def test_geocode_search_structured_get(self):
6868
"""Test case for geocode_search_structured_get

test/test_isochrones_service_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_get_default_isochrones(self):
4444
)
4545
profile = 'driving-car'
4646
response = self.api.get_default_isochrones(body, profile)
47-
self.assertEqual(len(response.features), 4)
47+
self.assertEqual(len(response["features"]), 4)
4848

4949

5050
if __name__ == '__main__':

test/test_matrix_service_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_get_default(self):
4444
profile = 'driving-car' # str | Specifies the matrix profile.
4545

4646
response = self.api.get_default1(body, profile)
47-
self.assertEqual(len(response.destinations), 4)
47+
self.assertEqual(len(response["destinations"]), 4)
4848

4949

5050
if __name__ == '__main__':

test/test_optimization_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_optimization_post(self):
4343
vehicles=[{"id":1,"profile":"driving-car","start":[2.35044,48.71764],"end":[2.35044,48.71764],"capacity":[4],"skills":[1,14],"time_window":[28800,43200]},{"id":2,"profile":"driving-car","start":[2.35044,48.71764],"end":[2.35044,48.71764],"capacity":[4],"skills":[2,14],"time_window":[28800,43200]}]
4444
)
4545
response = self.api.optimization_post(body)
46-
self.assertEqual(response.code, 0)
46+
self.assertEqual(response["code"], 0)
4747

4848

4949
if __name__ == '__main__':

test/test_pois_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ def test_pois_post(self):
5151

5252
response = self.api.pois_post(body)
5353
self.assertIsNotNone(response)
54-
self.assertEqual(response.type, "FeatureCollection")
54+
self.assertEqual(response["type"], "FeatureCollection")
5555

5656
body.filters = ors.PoisFilters(
5757
smoking=['yes']
5858
)
5959

6060
response2 = self.api.pois_post(body)
6161
self.assertIsNotNone(response2)
62-
self.assertGreaterEqual(len(response.features), len(response2.features))
62+
self.assertGreaterEqual(len(response["features"]), len(response2["features"]))
6363

6464
if __name__ == '__main__':
6565
unittest.main()

0 commit comments

Comments
 (0)