Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Add a second response for Python 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean C. Gillies committed Jan 6, 2018
1 parent 68b53c6 commit ec9c2b7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ def test_matrix(waypoints):
status=200,
content_type='application/json')

# We need a second response because of the difference in rounding between
# Python 2 (leaves a '.0') and 3 (no unnecessary '.0').
responses.add(
responses.GET,
'https://api.mapbox.com/directions-matrix/v1/mapbox/driving/-8.0,36.0;-86.0,36.0;-88.0,37.0?access_token=pk.test',
match_querystring=True,
body='{"durations":[[0,4977,5951],[4963,0,9349],[5881,9317,0]]}',
status=200,
content_type='application/json')
res = mapbox.DirectionsMatrix(access_token='pk.test').matrix(waypoints)
matrix = res.json()['durations']
# 3x3 list
Expand Down

0 comments on commit ec9c2b7

Please sign in to comment.