diff --git a/CHANGELOG.md b/CHANGELOG.md index bf3e2e3..913b72a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ -v0.4.1 - 2/8/2017 +v0.5.0 - 17/8/2017 +------------------- +- Added support Driver APIs + +v0.4.1 - 2/7/2017 ------------------- - Made state token optional in authorization code grant diff --git a/LICENSE b/LICENSE index 4aa5b8e..f0fcc60 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2016 Uber Technologies, Inc. +Copyright (c) 2015-2017 Uber Technologies, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +THE SOFTWARE. diff --git a/example/authorize_user.py b/example/authorize_user.py index f6a91a5..e6f4ce3 100644 --- a/example/authorize_user.py +++ b/example/authorize_user.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/example/request_ride.py b/example/request_ride.py index 5e785ca..c350078 100644 --- a/example/request_ride.py +++ b/example/request_ride.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/example/utils.py b/example/utils.py index fb560c5..3116f79 100644 --- a/example/utils.py +++ b/example/utils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/requirements.txt b/requirements.txt index 8a88433..2ba9434 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,18 +1,18 @@ -appdirs>=1.4.3 -certifi>=2017.7.27.1 -chardet>=3.0.4 -contextlib2>=0.5.5 -funcsigs>=1.0.2 -idna>=2.5 -mock>=2.0.0 -packaging>=16.8 -pbr>=3.1.1 -py>=1.4.34 -pyparsing>=2.2.0 -pytest>=3.1.3 -PyYAML>=3.12 -requests>=2.18.2 -six>=1.10.0 -urllib3>=1.22 -vcrpy>=1.11.1 -wrapt>=1.10.10 +appdirs==1.4.3 +certifi==2017.7.27.1 +chardet==3.0.4 +contextlib2==0.5.5 +funcsigs==1.0.2 +idna==2.5 +mock==2.0.0 +packaging==16.8 +pbr==3.1.1 +py==1.4.34 +pyparsing==2.2.0 +pytest==3.2.0 +PyYAML==3.12 +requests==2.18.3 +six==1.10.0 +urllib3==1.22 +vcrpy==1.11.1 +wrapt==1.10.10 diff --git a/setup.py b/setup.py index 4cd8aa3..5eeb085 100755 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( name='uber_rides', - version='0.4.1', + version='0.5.0', packages=find_packages(), description='Official Uber Rides API Python SDK', long_description=readme, diff --git a/tests/fixtures/test_cancel_current_ride b/tests/fixtures/test_cancel_current_ride index 1b3dcf3..a8d6dee 100644 --- a/tests/fixtures/test_cancel_current_ride +++ b/tests/fixtures/test_cancel_current_ride @@ -3,7 +3,7 @@ interactions: body: null headers: Content-Length: ['0'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: DELETE uri: https://sandbox-api.uber.com/v1.2/requests/current response: @@ -23,7 +23,7 @@ interactions: body: null headers: Content-Length: ['0'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: DELETE uri: https://sandbox-api.uber.com/v1.2/requests/current response: @@ -43,7 +43,7 @@ interactions: body: null headers: Content-Length: ['0'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: DELETE uri: https://sandbox-api.uber.com/v1.2/requests/current response: @@ -63,7 +63,7 @@ interactions: body: null headers: Content-Length: ['0'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: DELETE uri: https://sandbox-api.uber.com/v1.2/requests/current response: diff --git a/tests/fixtures/test_cancel_ride b/tests/fixtures/test_cancel_ride index c15b108..a6fa556 100644 --- a/tests/fixtures/test_cancel_ride +++ b/tests/fixtures/test_cancel_ride @@ -3,7 +3,7 @@ interactions: body: null headers: Content-Length: ['0'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: DELETE uri: https://sandbox-api.uber.com/v1.2/requests/9bdb3278-21bd-46b8-90fa-51404b0d6acf response: @@ -23,7 +23,7 @@ interactions: body: null headers: Content-Length: ['0'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: DELETE uri: https://sandbox-api.uber.com/v1.2/requests/610d868b-e21c-483a-9932-97e61b852fd2 response: @@ -43,7 +43,7 @@ interactions: body: null headers: Content-Length: ['0'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: DELETE uri: https://sandbox-api.uber.com/v1.2/requests/0aec0061-1e20-4239-a0b7-78328e9afec8 response: @@ -63,7 +63,7 @@ interactions: body: null headers: Content-Length: ['0'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: DELETE uri: https://sandbox-api.uber.com/v1.2/requests/0aec0061-1e20-4239-a0b7-78328e9afec8 response: diff --git a/tests/fixtures/test_estimate_ride b/tests/fixtures/test_estimate_ride index c94202a..d33aeb5 100644 --- a/tests/fixtures/test_estimate_ride +++ b/tests/fixtures/test_estimate_ride @@ -6,7 +6,7 @@ interactions: "start_place_id": null}' headers: Content-Length: ['241'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests/estimate @@ -32,7 +32,7 @@ interactions: "start_place_id": null}' headers: Content-Length: ['241'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests/estimate @@ -58,7 +58,7 @@ interactions: "start_place_id": null}' headers: Content-Length: ['241'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests/estimate @@ -84,7 +84,7 @@ interactions: "start_place_id": null}' headers: Content-Length: ['241'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests/estimate diff --git a/tests/fixtures/test_estimate_ride_with_places b/tests/fixtures/test_estimate_ride_with_places index a63d1ba..4aee31b 100644 --- a/tests/fixtures/test_estimate_ride_with_places +++ b/tests/fixtures/test_estimate_ride_with_places @@ -5,7 +5,7 @@ interactions: null, "end_place_id": "work", "start_latitude": null, "start_place_id": "home"}' headers: Content-Length: ['218'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests/estimate @@ -30,7 +30,7 @@ interactions: null, "end_place_id": "work", "start_latitude": null, "start_place_id": "home"}' headers: Content-Length: ['218'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests/estimate @@ -55,7 +55,7 @@ interactions: null, "end_place_id": "work", "start_latitude": null, "start_place_id": "home"}' headers: Content-Length: ['218'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests/estimate @@ -80,7 +80,7 @@ interactions: null, "end_place_id": "work", "start_latitude": null, "start_place_id": "home"}' headers: Content-Length: ['218'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests/estimate diff --git a/tests/fixtures/test_estimate_shared_ride b/tests/fixtures/test_estimate_shared_ride index 3ee756d..710f179 100644 --- a/tests/fixtures/test_estimate_shared_ride +++ b/tests/fixtures/test_estimate_shared_ride @@ -6,7 +6,7 @@ interactions: null}' headers: Content-Length: ['238'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests/estimate @@ -32,7 +32,7 @@ interactions: null}' headers: Content-Length: ['238'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests/estimate @@ -58,7 +58,7 @@ interactions: null}' headers: Content-Length: ['238'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests/estimate @@ -84,7 +84,7 @@ interactions: null}' headers: Content-Length: ['238'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests/estimate diff --git a/tests/fixtures/test_get_current_ride_details b/tests/fixtures/test_get_current_ride_details index a77c11f..bb5e6c9 100644 --- a/tests/fixtures/test_get_current_ride_details +++ b/tests/fixtures/test_get_current_ride_details @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/current response: @@ -24,7 +24,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/current response: @@ -44,7 +44,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/current response: @@ -66,7 +66,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/current response: diff --git a/tests/fixtures/test_get_current_shared_ride_details b/tests/fixtures/test_get_current_shared_ride_details index a0597e2..fa25251 100644 --- a/tests/fixtures/test_get_current_shared_ride_details +++ b/tests/fixtures/test_get_current_shared_ride_details @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/current response: @@ -24,7 +24,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/current response: @@ -44,7 +44,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/current response: @@ -66,7 +66,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/current response: diff --git a/tests/fixtures/test_get_driver_payments b/tests/fixtures/test_get_driver_payments new file mode 100644 index 0000000..be7099f --- /dev/null +++ b/tests/fixtures/test_get_driver_payments @@ -0,0 +1,28 @@ +interactions: +- request: + body: null + headers: + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] + method: GET + uri: https://api.uber.com/v1/partners/payments + response: + body: {string: !!python/unicode '{"count":13,"limit":10,"payments":[{"payment_id":"5cb8304c-f3f0-4a46-b6e3-b55e020750d7","category":"fare","event_time":1502842757,"trip_id":"5cb8304c-f3f0-4a46-b6e3-b55e020750d7","cash_collected":0.0,"amount":3.12,"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","breakdown":{"other":4.16,"service_fee":-1.04},"rider_fees":{},"partner_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","currency_code":"USD"},{"payment_id":"a9d1efa8-f2b1-46a2-acee-6847c752b0eb","category":"fare","event_time":1502841851,"trip_id":"a9d1efa8-f2b1-46a2-acee-6847c752b0eb","cash_collected":0.0,"amount":4.49,"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","breakdown":{"other":5.99,"service_fee":-1.5},"rider_fees":{},"partner_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","currency_code":"USD"},{"payment_id":"da30d9ce-4592-40fe-9ba9-c9b970d1d391","category":"fare","event_time":1502841640,"trip_id":"da30d9ce-4592-40fe-9ba9-c9b970d1d391","cash_collected":0.0,"amount":3.0,"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","breakdown":{"other":4.0,"service_fee":-1.0},"rider_fees":{},"partner_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","currency_code":"USD"},{"payment_id":"b5613b6a-fe74-4704-a637-50f8d51a8bb1","category":"fare","event_time":1502843894,"trip_id":"b5613b6a-fe74-4704-a637-50f8d51a8bb1","cash_collected":0.0,"amount":3.0,"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","breakdown":{"other":4.0,"service_fee":-1.0},"rider_fees":{},"partner_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","currency_code":"USD"},{"payment_id":"50eebfa4-9985-41ca-bbd9-be0150e32d4c","category":"fare","event_time":1502842172,"trip_id":"50eebfa4-9985-41ca-bbd9-be0150e32d4c","cash_collected":0.0,"amount":3.0,"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","breakdown":{"other":4.0,"service_fee":-1.0},"rider_fees":{},"partner_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","currency_code":"USD"},{"payment_id":"ba950c43-c57a-4ab8-a8db-2057dd30756b","category":"fare","event_time":1502842655,"trip_id":"ba950c43-c57a-4ab8-a8db-2057dd30756b","cash_collected":0.0,"amount":3.0,"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","breakdown":{"other":4.0,"service_fee":-1.0},"rider_fees":{},"partner_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","currency_code":"USD"},{"payment_id":"9ffeb986-0a73-4312-bb5e-22a1cc13e495","category":"fare","event_time":1502842917,"trip_id":"9ffeb986-0a73-4312-bb5e-22a1cc13e495","cash_collected":0.0,"amount":3.0,"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","breakdown":{"other":4.0,"service_fee":-1.0},"rider_fees":{},"partner_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","currency_code":"USD"},{"payment_id":"4415e5f6-60f2-451f-ade1-c3d6ae286d76","category":"fare","event_time":1502843623,"trip_id":"4415e5f6-60f2-451f-ade1-c3d6ae286d76","cash_collected":0.0,"amount":3.0,"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","breakdown":{"other":4.0,"service_fee":-1.0},"rider_fees":{},"partner_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","currency_code":"USD"},{"payment_id":"43851410-34ba-4054-9a4e-711e4e6a8fe5","category":"fare","event_time":1502843338,"trip_id":"43851410-34ba-4054-9a4e-711e4e6a8fe5","cash_collected":0.0,"amount":3.0,"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","breakdown":{"other":4.0,"service_fee":-1.0},"rider_fees":{},"partner_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","currency_code":"USD"},{"payment_id":"020f251b-e8ac-4ad1-ae9f-543a0db6b294","category":"fare","event_time":1502830183,"trip_id":"020f251b-e8ac-4ad1-ae9f-543a0db6b294","cash_collected":0.0,"amount":4.34,"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","breakdown":{"other":5.79,"service_fee":-1.45},"rider_fees":{},"partner_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","currency_code":"USD"}],"offset":0}'} + headers: + cache-control: [max-age=0] + connection: [keep-alive] + content-language: [en] + content-type: [application/json] + date: ['Wed, 16 Aug 2017 22:54:50 GMT'] + etag: [W/"a757f6e22e2dffdb1ccece2423b5f517f01ca791"] + server: [nginx] + strict-transport-security: [max-age=604800, max-age=2592000] + transfer-encoding: [chunked] + x-content-type-options: [nosniff] + x-frame-options: [SAMEORIGIN] + x-rate-limit-limit: ['2000'] + x-rate-limit-remaining: ['1995'] + x-rate-limit-reset: ['1502924400'] + x-uber-app: [uberex-nonsandbox, optimus] + x-xss-protection: [1; mode=block] + status: {code: 200, message: OK} +version: 1 diff --git a/tests/fixtures/test_get_driver_profile b/tests/fixtures/test_get_driver_profile new file mode 100644 index 0000000..e2af295 --- /dev/null +++ b/tests/fixtures/test_get_driver_profile @@ -0,0 +1,28 @@ +interactions: +- request: + body: null + headers: + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] + method: GET + uri: https://api.uber.com/v1/partners/me + response: + body: {string: !!python/unicode '{"phone_number":"+14075550001","picture":"https:\/\/d1w2poirtb3as9.cloudfront.net\/16ce502f4767f17b120e.jpeg","first_name":"Uber","last_name":"Tester","promo_code":"ubert4544ue","rating":5.0,"activation_status":"active","driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","email":"uber.developer+tester@example.com"}'} + headers: + cache-control: [max-age=0] + connection: [keep-alive] + content-language: [en] + content-length: ['419'] + content-type: [application/json] + date: ['Wed, 16 Aug 2017 22:54:50 GMT'] + etag: [W/"d76d91610e42a7b0d6e551766905af177b466447"] + server: [nginx] + strict-transport-security: [max-age=604800, max-age=2592000] + x-content-type-options: [nosniff] + x-frame-options: [SAMEORIGIN] + x-rate-limit-limit: ['2000'] + x-rate-limit-remaining: ['1997'] + x-rate-limit-reset: ['1502924400'] + x-uber-app: [uberex-nonsandbox, optimus] + x-xss-protection: [1; mode=block] + status: {code: 200, message: OK} +version: 1 diff --git a/tests/fixtures/test_get_driver_trips b/tests/fixtures/test_get_driver_trips new file mode 100644 index 0000000..bee0327 --- /dev/null +++ b/tests/fixtures/test_get_driver_trips @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] + method: GET + uri: https://api.uber.com/v1/partners/trips + response: + body: {string: !!python/unicode '{"count":13,"limit":10,"trips":[{"fare":6.2,"dropoff":{"timestamp":1502844378},"vehicle_id":"0082b54a-6a5e-4f6b-b999-b0649f286381","distance":0.37,"start_city":{"latitude":38.3498,"display_name":"Charleston, + WV","longitude":-81.6326},"status_changes":[{"status":"accepted","timestamp":1502843899},{"status":"driver_arrived","timestamp":1502843900},{"status":"trip_began","timestamp":1502843903},{"status":"completed","timestamp":1502844378}],"surge_multiplier":1.0,"pickup":{"timestamp":1502843903},"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","status":"completed","duration":475,"trip_id":"b5613b6a-fe74-4704-a637-50f8d51a8bb1","currency_code":"USD"},{"fare":6.4,"dropoff":{"timestamp":1502843883},"vehicle_id":"0082b54a-6a5e-4f6b-b999-b0649f286381","distance":0.96,"start_city":{"latitude":38.3498,"display_name":"Charleston, + WV","longitude":-81.6326},"status_changes":[{"status":"accepted","timestamp":1502843627},{"status":"driver_arrived","timestamp":1502843627},{"status":"trip_began","timestamp":1502843631},{"status":"completed","timestamp":1502843883}],"surge_multiplier":1.0,"pickup":{"timestamp":1502843631},"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","status":"completed","duration":253,"trip_id":"4415e5f6-60f2-451f-ade1-c3d6ae286d76","currency_code":"USD"},{"fare":6.2,"dropoff":{"timestamp":1502843563},"vehicle_id":"0082b54a-6a5e-4f6b-b999-b0649f286381","distance":0.0,"start_city":{"latitude":38.3498,"display_name":"Charleston, + WV","longitude":-81.6326},"status_changes":[{"status":"accepted","timestamp":1502843343},{"status":"driver_arrived","timestamp":1502843343},{"status":"trip_began","timestamp":1502843346},{"status":"completed","timestamp":1502843563}],"surge_multiplier":1.0,"pickup":{"timestamp":1502843346},"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","status":"completed","duration":217,"trip_id":"43851410-34ba-4054-9a4e-711e4e6a8fe5","currency_code":"USD"},{"fare":13.35,"dropoff":{"timestamp":1502843227},"vehicle_id":"0082b54a-6a5e-4f6b-b999-b0649f286381","distance":3.51,"start_city":{"latitude":38.3498,"display_name":"Charleston, + WV","longitude":-81.6326},"status_changes":[{"status":"accepted","timestamp":1502843039},{"status":"driver_arrived","timestamp":1502843040},{"status":"trip_began","timestamp":1502843043},{"status":"completed","timestamp":1502843227}],"surge_multiplier":1.0,"pickup":{"timestamp":1502843043},"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","status":"completed","duration":184,"trip_id":"fe8f00d9-2bd0-464a-82fe-8ce1ffd27057","currency_code":"USD"},{"fare":6.55,"dropoff":{"timestamp":1502843010},"vehicle_id":"0082b54a-6a5e-4f6b-b999-b0649f286381","distance":1.14,"start_city":{"latitude":38.3498,"display_name":"Charleston, + WV","longitude":-81.6326},"status_changes":[{"status":"accepted","timestamp":1502842919},{"status":"driver_arrived","timestamp":1502842919},{"status":"trip_began","timestamp":1502842922},{"status":"completed","timestamp":1502843010}],"surge_multiplier":1.0,"pickup":{"timestamp":1502842922},"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","status":"completed","duration":88,"trip_id":"9ffeb986-0a73-4312-bb5e-22a1cc13e495","currency_code":"USD"},{"fare":7.13,"dropoff":{"timestamp":1502842902},"vehicle_id":"0082b54a-6a5e-4f6b-b999-b0649f286381","distance":1.42,"start_city":{"latitude":38.3498,"display_name":"Charleston, + WV","longitude":-81.6326},"status_changes":[{"status":"accepted","timestamp":1502842761},{"status":"driver_arrived","timestamp":1502842761},{"status":"trip_began","timestamp":1502842763},{"status":"completed","timestamp":1502842902}],"surge_multiplier":1.0,"pickup":{"timestamp":1502842763},"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","status":"completed","duration":140,"trip_id":"5cb8304c-f3f0-4a46-b6e3-b55e020750d7","currency_code":"USD"},{"fare":6.53,"dropoff":null,"vehicle_id":"0082b54a-6a5e-4f6b-b999-b0649f286381","distance":0.72,"start_city":{"latitude":38.3498,"display_name":"Charleston, + WV","longitude":-81.6326},"status_changes":[{"status":"accepted","timestamp":1502842659},{"status":"driver_arrived","timestamp":1502842660},{"status":"trip_began","timestamp":1502842662},{"status":"rider_canceled","timestamp":1502842731}],"surge_multiplier":1.0,"pickup":{"timestamp":1502842662},"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","status":"rider_canceled","duration":68,"trip_id":"ba950c43-c57a-4ab8-a8db-2057dd30756b","currency_code":"USD"},{"fare":9.68,"dropoff":{"timestamp":1502842611},"vehicle_id":"0082b54a-6a5e-4f6b-b999-b0649f286381","distance":3.82,"start_city":{"latitude":38.3498,"display_name":"Charleston, + WV","longitude":-81.6326},"status_changes":[{"status":"accepted","timestamp":1502842336},{"status":"driver_arrived","timestamp":1502842336},{"status":"trip_began","timestamp":1502842338},{"status":"completed","timestamp":1502842611}],"surge_multiplier":1.0,"pickup":{"timestamp":1502842338},"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","status":"completed","duration":273,"trip_id":"d80ea4dd-3eca-4215-8224-4162cd72eefb","currency_code":"USD"},{"fare":6.2,"dropoff":{"timestamp":1502842242},"vehicle_id":"0082b54a-6a5e-4f6b-b999-b0649f286381","distance":0.38,"start_city":{"latitude":38.3498,"display_name":"Charleston, + WV","longitude":-81.6326},"status_changes":[{"status":"accepted","timestamp":1502842176},{"status":"driver_arrived","timestamp":1502842177},{"status":"trip_began","timestamp":1502842180},{"status":"completed","timestamp":1502842242}],"surge_multiplier":1.0,"pickup":{"timestamp":1502842180},"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","status":"completed","duration":63,"trip_id":"50eebfa4-9985-41ca-bbd9-be0150e32d4c","currency_code":"USD"},{"fare":8.99,"dropoff":{"timestamp":1502842126},"vehicle_id":"0082b54a-6a5e-4f6b-b999-b0649f286381","distance":2.8,"start_city":{"latitude":38.3498,"display_name":"Charleston, + WV","longitude":-81.6326},"status_changes":[{"status":"accepted","timestamp":1502841856},{"status":"driver_arrived","timestamp":1502841859},{"status":"trip_began","timestamp":1502841861},{"status":"completed","timestamp":1502842126}],"surge_multiplier":1.0,"pickup":{"timestamp":1502841861},"driver_id":"8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","status":"completed","duration":264,"trip_id":"a9d1efa8-f2b1-46a2-acee-6847c752b0eb","currency_code":"USD"}],"offset":0}'} + headers: + cache-control: [max-age=0] + connection: [keep-alive] + content-language: [en] + content-type: [application/json] + date: ['Wed, 16 Aug 2017 22:54:50 GMT'] + etag: [W/"7341e30342fe59d8119b66b04f314ce1a7ab275f"] + server: [nginx] + strict-transport-security: [max-age=604800, max-age=2592000] + transfer-encoding: [chunked] + x-content-type-options: [nosniff] + x-frame-options: [SAMEORIGIN] + x-rate-limit-limit: ['2000'] + x-rate-limit-remaining: ['1996'] + x-rate-limit-reset: ['1502924400'] + x-uber-app: [uberex-nonsandbox, optimus] + x-xss-protection: [1; mode=block] + status: {code: 200, message: OK} +version: 1 diff --git a/tests/fixtures/test_get_home_address b/tests/fixtures/test_get_home_address index e5a266d..5b85d2d 100644 --- a/tests/fixtures/test_get_home_address +++ b/tests/fixtures/test_get_home_address @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/places/home response: @@ -24,7 +24,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/places/home response: @@ -46,7 +46,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/places/home response: @@ -68,7 +68,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/places/home response: diff --git a/tests/fixtures/test_get_payment_methods b/tests/fixtures/test_get_payment_methods index f718bef..55d3a65 100644 --- a/tests/fixtures/test_get_payment_methods +++ b/tests/fixtures/test_get_payment_methods @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/payment-methods response: @@ -23,7 +23,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/payment-methods response: @@ -44,7 +44,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/payment-methods response: @@ -65,7 +65,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/payment-methods response: diff --git a/tests/fixtures/test_get_pickup_time_estimates b/tests/fixtures/test_get_pickup_time_estimates index 6152f53..0ecb234 100644 --- a/tests/fixtures/test_get_pickup_time_estimates +++ b/tests/fixtures/test_get_pickup_time_estimates @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/estimates/time?start_latitude=37.7899886&start_longitude=-122.4021253 response: @@ -24,7 +24,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/estimates/time?start_latitude=37.7899886&start_longitude=-122.4021253 response: @@ -46,7 +46,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/estimates/time?start_latitude=37.7899886&start_longitude=-122.4021253 response: @@ -68,7 +68,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/estimates/time?start_latitude=37.7899886&start_longitude=-122.4021253 response: @@ -90,7 +90,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/estimates/time?start_latitude=37.7899886&start_longitude=-122.4021253 response: @@ -112,7 +112,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/estimates/time?start_latitude=37.7899886&start_longitude=-122.4021253 response: @@ -134,7 +134,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/estimates/time?start_latitude=37.7899886&start_longitude=-122.4021253 response: @@ -156,7 +156,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/estimates/time?start_latitude=37.7899886&start_longitude=-122.4021253 response: diff --git a/tests/fixtures/test_get_price_estimates b/tests/fixtures/test_get_price_estimates index b510e74..9eb98c8 100644 --- a/tests/fixtures/test_get_price_estimates +++ b/tests/fixtures/test_get_price_estimates @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/estimates/price?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513&seat_count=2 response: @@ -24,7 +24,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/estimates/price?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513&seat_count=2 response: @@ -46,7 +46,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/estimates/price?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513&seat_count=2 response: @@ -68,7 +68,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/estimates/price?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513&seat_count=2 response: @@ -90,7 +90,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/estimates/price?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513&seat_count=2 response: @@ -112,7 +112,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/estimates/price?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513&seat_count=2 response: @@ -134,7 +134,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/estimates/price?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513&seat_count=2 response: @@ -156,7 +156,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/estimates/price?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513&seat_count=2 response: diff --git a/tests/fixtures/test_get_products b/tests/fixtures/test_get_products index 4368c21..0fa734a 100644 --- a/tests/fixtures/test_get_products +++ b/tests/fixtures/test_get_products @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/products?latitude=37.7899886&longitude=-122.4021253 response: @@ -33,7 +33,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/products?latitude=37.7899886&longitude=-122.4021253 response: @@ -64,7 +64,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/products?latitude=37.7899886&longitude=-122.4021253 response: @@ -95,7 +95,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/products?latitude=37.7899886&longitude=-122.4021253 response: @@ -126,7 +126,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/products?latitude=37.7899886&longitude=-122.4021253 response: @@ -157,7 +157,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/products?latitude=37.7899886&longitude=-122.4021253 response: @@ -188,7 +188,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/products?latitude=37.7899886&longitude=-122.4021253 response: @@ -219,7 +219,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/products?latitude=37.7899886&longitude=-122.4021253 response: diff --git a/tests/fixtures/test_get_promotions b/tests/fixtures/test_get_promotions index 93ef175..85cd36e 100644 --- a/tests/fixtures/test_get_promotions +++ b/tests/fixtures/test_get_promotions @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/promotions?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513 response: @@ -23,7 +23,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/promotions?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513 response: @@ -44,7 +44,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/promotions?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513 response: @@ -65,7 +65,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/promotions?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513 response: @@ -86,7 +86,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/promotions?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513 response: @@ -107,7 +107,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/promotions?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513 response: @@ -128,7 +128,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/promotions?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513 response: @@ -149,7 +149,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/promotions?start_latitude=37.7899886&start_longitude=-122.4021253&end_latitude=37.775232&end_longitude=-122.4197513 response: diff --git a/tests/fixtures/test_get_ride_details b/tests/fixtures/test_get_ride_details index f457406..d32a67d 100644 --- a/tests/fixtures/test_get_ride_details +++ b/tests/fixtures/test_get_ride_details @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/9bdb3278-21bd-46b8-90fa-51404b0d6acf response: @@ -21,7 +21,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/610d868b-e21c-483a-9932-97e61b852fd2 response: @@ -42,7 +42,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/0aec0061-1e20-4239-a0b7-78328e9afec8 response: @@ -64,7 +64,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/0aec0061-1e20-4239-a0b7-78328e9afec8 response: diff --git a/tests/fixtures/test_get_ride_map b/tests/fixtures/test_get_ride_map index 1b9004c..4eb50ad 100644 --- a/tests/fixtures/test_get_ride_map +++ b/tests/fixtures/test_get_ride_map @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/0aec0061-1e20-4239-a0b7-78328e9afec8/map response: diff --git a/tests/fixtures/test_get_ride_receipt b/tests/fixtures/test_get_ride_receipt index 5e2a11b..e7478cb 100644 --- a/tests/fixtures/test_get_ride_receipt +++ b/tests/fixtures/test_get_ride_receipt @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/requests/0aec0061-1e20-4239-a0b7-78328e9afec8/receipt response: diff --git a/tests/fixtures/test_get_single_product b/tests/fixtures/test_get_single_product index 9fc535e..6d8250e 100644 --- a/tests/fixtures/test_get_single_product +++ b/tests/fixtures/test_get_single_product @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/products/821415d8-3bd5-4e27-9604-194e4359a449 response: @@ -25,7 +25,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/products/821415d8-3bd5-4e27-9604-194e4359a449 response: @@ -48,7 +48,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/products/821415d8-3bd5-4e27-9604-194e4359a449 response: @@ -71,7 +71,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/products/821415d8-3bd5-4e27-9604-194e4359a449 response: @@ -94,7 +94,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/products/821415d8-3bd5-4e27-9604-194e4359a449 response: @@ -117,7 +117,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/products/821415d8-3bd5-4e27-9604-194e4359a449 response: @@ -140,7 +140,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/products/821415d8-3bd5-4e27-9604-194e4359a449 response: @@ -163,7 +163,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://api.uber.com/v1.2/products/821415d8-3bd5-4e27-9604-194e4359a449 response: diff --git a/tests/fixtures/test_get_user_activity b/tests/fixtures/test_get_user_activity index 254b138..13533e4 100644 --- a/tests/fixtures/test_get_user_activity +++ b/tests/fixtures/test_get_user_activity @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/history response: @@ -28,7 +28,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/history response: @@ -54,7 +54,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/history response: @@ -80,7 +80,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/history response: diff --git a/tests/fixtures/test_get_user_profile b/tests/fixtures/test_get_user_profile index d8cb7ac..52678be 100644 --- a/tests/fixtures/test_get_user_profile +++ b/tests/fixtures/test_get_user_profile @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/me response: @@ -23,7 +23,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/me response: @@ -44,7 +44,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/me response: @@ -65,7 +65,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/me response: diff --git a/tests/fixtures/test_get_work_address b/tests/fixtures/test_get_work_address index e0c143c..7359415 100644 --- a/tests/fixtures/test_get_work_address +++ b/tests/fixtures/test_get_work_address @@ -2,7 +2,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/places/work response: @@ -24,7 +24,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/places/work response: @@ -46,7 +46,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/places/work response: @@ -68,7 +68,7 @@ interactions: - request: body: null headers: - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] method: GET uri: https://sandbox-api.uber.com/v1.2/places/work response: diff --git a/tests/fixtures/test_request_ride b/tests/fixtures/test_request_ride index d3852d6..7a43810 100644 --- a/tests/fixtures/test_request_ride +++ b/tests/fixtures/test_request_ride @@ -8,7 +8,7 @@ interactions: "start_latitude": 37.7899886}' headers: Content-Length: ['468'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests @@ -36,7 +36,7 @@ interactions: "start_latitude": 37.7899886}' headers: Content-Length: ['468'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests @@ -64,7 +64,7 @@ interactions: "start_latitude": 37.7899886}' headers: Content-Length: ['468'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests @@ -92,7 +92,7 @@ interactions: "start_latitude": 37.7899886}' headers: Content-Length: ['468'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests diff --git a/tests/fixtures/test_request_ride_with_no_default_product b/tests/fixtures/test_request_ride_with_no_default_product index 6b84d89..4b9887b 100644 --- a/tests/fixtures/test_request_ride_with_no_default_product +++ b/tests/fixtures/test_request_ride_with_no_default_product @@ -8,7 +8,7 @@ interactions: 37.7899886}' headers: Content-Length: ['434'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests @@ -36,7 +36,7 @@ interactions: 37.7899886}' headers: Content-Length: ['434'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests @@ -64,7 +64,7 @@ interactions: 37.7899886}' headers: Content-Length: ['434'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests @@ -92,7 +92,7 @@ interactions: 37.7899886}' headers: Content-Length: ['434'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests diff --git a/tests/fixtures/test_request_ride_with_places b/tests/fixtures/test_request_ride_with_places index 42eb6ee..f1020a9 100644 --- a/tests/fixtures/test_request_ride_with_places +++ b/tests/fixtures/test_request_ride_with_places @@ -8,7 +8,7 @@ interactions: null}' headers: Content-Length: ['445'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests @@ -36,7 +36,7 @@ interactions: null}' headers: Content-Length: ['445'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests @@ -64,7 +64,7 @@ interactions: null}' headers: Content-Length: ['445'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests @@ -92,7 +92,7 @@ interactions: null}' headers: Content-Length: ['445'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests diff --git a/tests/fixtures/test_request_ride_with_surge b/tests/fixtures/test_request_ride_with_surge index c7caf73..85d9532 100644 --- a/tests/fixtures/test_request_ride_with_surge +++ b/tests/fixtures/test_request_ride_with_surge @@ -8,7 +8,7 @@ interactions: "start_latitude": -22.9674153}' headers: Content-Length: ['407'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests diff --git a/tests/fixtures/test_request_shared_ride b/tests/fixtures/test_request_shared_ride index 27784b2..7637b2a 100644 --- a/tests/fixtures/test_request_shared_ride +++ b/tests/fixtures/test_request_shared_ride @@ -8,7 +8,7 @@ interactions: "start_latitude": 37.7899886}' headers: Content-Length: ['465'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests @@ -36,7 +36,7 @@ interactions: "start_latitude": 37.7899886}' headers: Content-Length: ['465'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests @@ -64,7 +64,7 @@ interactions: "start_latitude": 37.7899886}' headers: Content-Length: ['465'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests @@ -92,7 +92,7 @@ interactions: "start_latitude": 37.7899886}' headers: Content-Length: ['465'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: POST uri: https://sandbox-api.uber.com/v1.2/requests diff --git a/tests/fixtures/test_set_home_address b/tests/fixtures/test_set_home_address index 2a2cdc3..ad70441 100644 --- a/tests/fixtures/test_set_home_address +++ b/tests/fixtures/test_set_home_address @@ -3,7 +3,7 @@ interactions: body: !!python/unicode '{"address": "555 Market Street, SF"}' headers: Content-Length: ['36'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/places/home @@ -26,7 +26,7 @@ interactions: body: !!python/unicode '{"address": "555 Market Street, SF"}' headers: Content-Length: ['36'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/places/home @@ -49,7 +49,7 @@ interactions: body: !!python/unicode '{"address": "555 Market Street, SF"}' headers: Content-Length: ['36'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/places/home @@ -72,7 +72,7 @@ interactions: body: !!python/unicode '{"address": "555 Market Street, SF"}' headers: Content-Length: ['36'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/places/home diff --git a/tests/fixtures/test_set_work_address b/tests/fixtures/test_set_work_address index ec31fcc..44df77a 100644 --- a/tests/fixtures/test_set_work_address +++ b/tests/fixtures/test_set_work_address @@ -3,7 +3,7 @@ interactions: body: !!python/unicode '{"address": "1455 Market Street, SF"}' headers: Content-Length: ['37'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/places/work @@ -26,7 +26,7 @@ interactions: body: !!python/unicode '{"address": "1455 Market Street, SF"}' headers: Content-Length: ['37'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/places/work @@ -49,7 +49,7 @@ interactions: body: !!python/unicode '{"address": "1455 Market Street, SF"}' headers: Content-Length: ['37'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/places/work @@ -72,7 +72,7 @@ interactions: body: !!python/unicode '{"address": "1455 Market Street, SF"}' headers: Content-Length: ['37'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/places/work diff --git a/tests/fixtures/test_update_ride_destination b/tests/fixtures/test_update_ride_destination index 588d622..dad3cd4 100644 --- a/tests/fixtures/test_update_ride_destination +++ b/tests/fixtures/test_update_ride_destination @@ -3,7 +3,7 @@ interactions: body: !!python/unicode '{"end_longitude": -122.4197515, "end_latitude": 37.775234}' headers: Content-Length: ['58'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PATCH uri: https://sandbox-api.uber.com/v1.2/requests/9bdb3278-21bd-46b8-90fa-51404b0d6acf @@ -25,7 +25,7 @@ interactions: body: !!python/unicode '{"end_longitude": -122.4197515, "end_latitude": 37.775234}' headers: Content-Length: ['58'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PATCH uri: https://sandbox-api.uber.com/v1.2/requests/610d868b-e21c-483a-9932-97e61b852fd2 @@ -48,7 +48,7 @@ interactions: body: !!python/unicode '{"end_longitude": -122.4197515, "end_latitude": 37.775234}' headers: Content-Length: ['58'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PATCH uri: https://sandbox-api.uber.com/v1.2/requests/0aec0061-1e20-4239-a0b7-78328e9afec8 @@ -69,7 +69,7 @@ interactions: body: !!python/unicode '{"end_longitude": -122.4197515, "end_latitude": 37.775234}' headers: Content-Length: ['58'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PATCH uri: https://sandbox-api.uber.com/v1.2/requests/0aec0061-1e20-4239-a0b7-78328e9afec8 diff --git a/tests/fixtures/test_update_ride_destination_with_places b/tests/fixtures/test_update_ride_destination_with_places index af00599..ef97e10 100644 --- a/tests/fixtures/test_update_ride_destination_with_places +++ b/tests/fixtures/test_update_ride_destination_with_places @@ -3,7 +3,7 @@ interactions: body: !!python/unicode '{"end_place_id": "work"}' headers: Content-Length: ['24'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PATCH uri: https://sandbox-api.uber.com/v1.2/requests/9bdb3278-21bd-46b8-90fa-51404b0d6acf @@ -25,7 +25,7 @@ interactions: body: !!python/unicode '{"end_place_id": "work"}' headers: Content-Length: ['24'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PATCH uri: https://sandbox-api.uber.com/v1.2/requests/610d868b-e21c-483a-9932-97e61b852fd2 @@ -48,7 +48,7 @@ interactions: body: !!python/unicode '{"end_place_id": "work"}' headers: Content-Length: ['24'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PATCH uri: https://sandbox-api.uber.com/v1.2/requests/0aec0061-1e20-4239-a0b7-78328e9afec8 @@ -69,7 +69,7 @@ interactions: body: !!python/unicode '{"end_place_id": "work"}' headers: Content-Length: ['24'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PATCH uri: https://sandbox-api.uber.com/v1.2/requests/0aec0061-1e20-4239-a0b7-78328e9afec8 diff --git a/tests/fixtures/test_update_sandbox_product b/tests/fixtures/test_update_sandbox_product index fd41671..7fe96be 100644 --- a/tests/fixtures/test_update_sandbox_product +++ b/tests/fixtures/test_update_sandbox_product @@ -3,7 +3,7 @@ interactions: body: !!python/unicode '{"surge_multiplier": 2, "drivers_available": null}' headers: Content-Length: ['50'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/sandbox/products/d5ef01d9-7d54-413e-b265-425948d06e92 @@ -24,7 +24,7 @@ interactions: body: !!python/unicode '{"surge_multiplier": 2, "drivers_available": null}' headers: Content-Length: ['50'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/sandbox/products/d5ef01d9-7d54-413e-b265-425948d06e92 @@ -45,7 +45,7 @@ interactions: body: !!python/unicode '{"surge_multiplier": 2, "drivers_available": null}' headers: Content-Length: ['50'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/sandbox/products/d5ef01d9-7d54-413e-b265-425948d06e92 @@ -66,7 +66,7 @@ interactions: body: !!python/unicode '{"surge_multiplier": 2, "drivers_available": null}' headers: Content-Length: ['50'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/sandbox/products/d5ef01d9-7d54-413e-b265-425948d06e92 diff --git a/tests/fixtures/test_update_sandbox_ride b/tests/fixtures/test_update_sandbox_ride index 3927bf9..1289163 100644 --- a/tests/fixtures/test_update_sandbox_ride +++ b/tests/fixtures/test_update_sandbox_ride @@ -3,7 +3,7 @@ interactions: body: !!python/unicode '{"status": "accepted"}' headers: Content-Length: ['22'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/sandbox/requests/9bdb3278-21bd-46b8-90fa-51404b0d6acf @@ -24,7 +24,7 @@ interactions: body: !!python/unicode '{"status": "accepted"}' headers: Content-Length: ['22'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/sandbox/requests/610d868b-e21c-483a-9932-97e61b852fd2 @@ -45,7 +45,7 @@ interactions: body: !!python/unicode '{"status": "accepted"}' headers: Content-Length: ['22'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/sandbox/requests/0aec0061-1e20-4239-a0b7-78328e9afec8 @@ -66,7 +66,7 @@ interactions: body: !!python/unicode '{"status": "accepted"}' headers: Content-Length: ['22'] - X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.3.0] + X-Uber-User-Agent: [!!python/unicode Python Rides SDK v0.5.0] content-type: [application/json] method: PUT uri: https://sandbox-api.uber.com/v1.2/sandbox/requests/0aec0061-1e20-4239-a0b7-78328e9afec8 diff --git a/tests/test_auth.py b/tests/test_auth.py index 97e5cb5..434df75 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/tests/test_client.py b/tests/test_client.py index 56f10df..f2f8688 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -47,7 +47,7 @@ REFRESH_TOKEN = 'xxx' REDIRECT_URL = 'https://uberapitester.com/api/v1/uber/oauth' -SCOPES = { +RIDER_SCOPES = { 'profile', 'places', 'request', @@ -56,6 +56,12 @@ 'history' } +DRIVER_SCOPES = { + 'partner.accounts', + 'partner.trips', + 'partner.payments' + } + # replace these with valid identifiers to rerecord request-related fixtures RIDE_ID = '0aec0061-1e20-4239-a0b7-78328e9afec8' SURGE_ID = 'hsg2k38b' @@ -110,7 +116,7 @@ 'localized_display_name', 'estimate', 'display_name', - 'product_id', + 'product_id' ]) EXPECTED_PRICE_KEYS = set([ @@ -122,13 +128,13 @@ 'distance', 'duration', 'display_name', - 'product_id', + 'product_id' ]) EXPECTED_PROMOTION_KEYS = set([ 'display_text', 'localized_value', - 'type', + 'type' ]) EXPECTED_ACTIVITY_KEYS = set([ @@ -138,7 +144,7 @@ 'start_city', 'end_time', 'request_id', - 'product_id', + 'product_id' ]) EXPECTED_PROFILE_KEYS = set([ @@ -147,7 +153,7 @@ 'last_name', 'uuid', 'email', - 'promo_code', + 'promo_code' ]) EXPECTED_ESTIMATE_RIDE_FARE_KEYS = set([ @@ -155,19 +161,19 @@ 'fare_id', 'expires_at', 'currency_code', - 'display', + 'display' ]) EXPECTED_ESTIMATE_RIDE_TRIP_KEYS = set([ 'distance_unit', 'duration_estimate', - 'distance_estimate', + 'distance_estimate' ]) EXPECTED_ESTIMATE_SHARED_RIDE_TRIP_KEYS = set([ 'distance_unit', 'duration_estimate', - 'distance_estimate', + 'distance_estimate' ]) EXPECTED_RIDE_DETAILS_KEYS = set([ @@ -179,7 +185,7 @@ 'destination', 'location', 'vehicle', - 'shared', + 'shared' ]) EXPECTED_SHARED_RIDE_DETAILS_KEYS = set([ @@ -196,13 +202,13 @@ EXPECTED_RIDE_MAP_KEYS = set([ 'href', - 'request_id', + 'request_id' ]) EXPECTED_INDIVIDUAL_CHARGE_KEYS = set([ 'amount', 'type', - 'name', + 'name' ]) EXPECTED_RECEIPT_KEYS = set([ @@ -214,7 +220,7 @@ 'distance_label', 'request_id', 'duration', - 'subtotal', + 'subtotal' ]) EXPECTED_PLACE_KEYS = set(['address']) @@ -222,19 +228,70 @@ EXPECTED_PAYMENT_KEYS = set([ 'payment_method_id', 'type', - 'description', + 'description' +]) + +EXPECTED_DRIVER_PROFILE_KEYS = set([ + 'driver_id', + 'activation_status', + 'first_name', + 'last_name', + 'driver_id', + 'email', + 'phone_number', + 'picture', + 'promo_code', + 'rating' ]) +EXPECTED_DRIVER_TRIPS_KEYS = set([ + 'dropoff', + 'distance', + 'status_changes', + 'pickup', + 'driver_id', + 'status', + 'trip_id' +]) + +EXPECTED_DRIVER_PAYMENTS_KEYS = set([ + 'category', + 'breakdown', + 'rider_fees', + 'event_time', + 'trip_id', + 'payment_id', + 'amount', + 'driver_id', + 'partner_id', + 'currency_code' +]) + + +@fixture +def rider_oauth2credential(): + """Create OAuth2Credential class to hold access token information.""" + return OAuth2Credential( + client_id=CLIENT_ID, + redirect_url=REDIRECT_URL, + access_token=ACCESS_TOKEN, + expires_in_seconds=EXPIRES_IN_SECONDS, + scopes=RIDER_SCOPES, + grant_type=auth.AUTHORIZATION_CODE_GRANT, + client_secret=CLIENT_SECRET, + refresh_token=REFRESH_TOKEN, + ) + @fixture -def oauth2credential(): +def driver_oauth2credential(): """Create OAuth2Credential class to hold access token information.""" return OAuth2Credential( client_id=CLIENT_ID, redirect_url=REDIRECT_URL, access_token=ACCESS_TOKEN, expires_in_seconds=EXPIRES_IN_SECONDS, - scopes=SCOPES, + scopes=DRIVER_SCOPES, grant_type=auth.AUTHORIZATION_CODE_GRANT, client_secret=CLIENT_SECRET, refresh_token=REFRESH_TOKEN, @@ -242,16 +299,30 @@ def oauth2credential(): @fixture -def authorized_sandbox_client(oauth2credential): +def authorized_rider_sandbox_client(rider_oauth2credential): + """Create an UberRidesClient in Sandbox Mode with OAuth 2.0 Credentials.""" + session = Session(oauth2credential=rider_oauth2credential) + return UberRidesClient(session, sandbox_mode=True) + + +@fixture +def authorized_rider_production_client(rider_oauth2credential): + """Create an UberRidesClient in Production with OAuth 2.0 Credentials.""" + session = Session(oauth2credential=rider_oauth2credential) + return UberRidesClient(session) + + +@fixture +def authorized_driver_sandbox_client(driver_oauth2credential): """Create an UberRidesClient in Sandbox Mode with OAuth 2.0 Credentials.""" - session = Session(oauth2credential=oauth2credential) + session = Session(oauth2credential=driver_oauth2credential) return UberRidesClient(session, sandbox_mode=True) @fixture -def authorized_production_client(oauth2credential): +def authorized_driver_production_client(driver_oauth2credential): """Create an UberRidesClient in Production with OAuth 2.0 Credentials.""" - session = Session(oauth2credential=oauth2credential) + session = Session(oauth2credential=driver_oauth2credential) return UberRidesClient(session) @@ -292,9 +363,9 @@ def http_surge_error(): @uber_vcr.use_cassette() -def test_get_products(authorized_sandbox_client, server_token_client): +def test_get_products(authorized_rider_sandbox_client, server_token_client): """Test to fetch products with access token and server token.""" - clients = [authorized_sandbox_client, server_token_client] + clients = [authorized_rider_sandbox_client, server_token_client] for client in clients: response = client.get_products(START_LAT, START_LNG) @@ -311,9 +382,11 @@ def test_get_products(authorized_sandbox_client, server_token_client): @uber_vcr.use_cassette() -def test_get_single_product(authorized_sandbox_client, server_token_client): +def test_get_single_product(authorized_rider_sandbox_client, + server_token_client + ): """Test fetch product by ID with access token and server token.""" - clients = [authorized_sandbox_client, server_token_client] + clients = [authorized_rider_sandbox_client, server_token_client] for client in clients: response = client.get_product(UFP_PRODUCT_ID) @@ -326,9 +399,11 @@ def test_get_single_product(authorized_sandbox_client, server_token_client): @uber_vcr.use_cassette() -def test_get_price_estimates(authorized_sandbox_client, server_token_client): +def test_get_price_estimates(authorized_rider_sandbox_client, + server_token_client + ): """Test to fetch price estimates with access token and server token.""" - clients = [authorized_sandbox_client, server_token_client] + clients = [authorized_rider_sandbox_client, server_token_client] for client in clients: response = client.get_price_estimates( @@ -352,11 +427,11 @@ def test_get_price_estimates(authorized_sandbox_client, server_token_client): @uber_vcr.use_cassette() def test_get_pickup_time_estimates( - authorized_sandbox_client, + authorized_rider_sandbox_client, server_token_client, ): """Test to fetch time estimates with access token and server token.""" - clients = [authorized_sandbox_client, server_token_client] + clients = [authorized_rider_sandbox_client, server_token_client] for client in clients: response = client.get_pickup_time_estimates( @@ -376,9 +451,9 @@ def test_get_pickup_time_estimates( @uber_vcr.use_cassette() -def test_get_promotions(authorized_sandbox_client, server_token_client): +def test_get_promotions(authorized_rider_sandbox_client, server_token_client): """Test to fetch promotions with access token and server token.""" - clients = [authorized_sandbox_client, server_token_client] + clients = [authorized_rider_sandbox_client, server_token_client] for client in clients: response = client.get_promotions( @@ -395,9 +470,9 @@ def test_get_promotions(authorized_sandbox_client, server_token_client): @uber_vcr.use_cassette() -def test_get_user_activity(authorized_sandbox_client): +def test_get_user_activity(authorized_rider_sandbox_client): """Test to fetch user activity with access token.""" - response = authorized_sandbox_client.get_user_activity() + response = authorized_rider_sandbox_client.get_user_activity() assert response.status_code == codes.ok # assert response looks like user activity @@ -411,21 +486,21 @@ def test_get_user_activity(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_get_user_profile(authorized_sandbox_client): +def test_get_user_profile(authorized_rider_sandbox_client): """Test to fetch user profile with access token.""" - response = authorized_sandbox_client.get_user_profile() + response = authorized_rider_sandbox_client.get_user_profile() assert response.status_code == codes.ok - # assert response looks like use profile + # assert response looks like user profile response = response.json assert EXPECTED_PROFILE_KEYS.issubset(response) @uber_vcr.use_cassette() -def test_estimate_shared_ride(authorized_sandbox_client): +def test_estimate_shared_ride(authorized_rider_sandbox_client): """Test to estimate a shared ride.""" try: - response = authorized_sandbox_client.estimate_ride( + response = authorized_rider_sandbox_client.estimate_ride( product_id=UFP_SHARED_PRODUCT_ID, seat_count=UFP_SHARED_SEAT_COUNT, start_latitude=START_LAT, @@ -446,9 +521,9 @@ def test_estimate_shared_ride(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_estimate_ride(authorized_sandbox_client): +def test_estimate_ride(authorized_rider_sandbox_client): """Test to fetch ride estimate with access token.""" - response = authorized_sandbox_client.estimate_ride( + response = authorized_rider_sandbox_client.estimate_ride( product_id=UFP_PRODUCT_ID, start_latitude=START_LAT, start_longitude=START_LNG, @@ -466,9 +541,9 @@ def test_estimate_ride(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_estimate_ride_with_places(authorized_sandbox_client): +def test_estimate_ride_with_places(authorized_rider_sandbox_client): """Test to fetch ride estimate with place ids.""" - response = authorized_sandbox_client.estimate_ride( + response = authorized_rider_sandbox_client.estimate_ride( product_id=UFP_PRODUCT_ID, start_place_id='home', end_place_id='work', @@ -484,9 +559,9 @@ def test_estimate_ride_with_places(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_request_ride(authorized_sandbox_client): +def test_request_ride(authorized_rider_sandbox_client): """Test to request ride with access token.""" - response = authorized_sandbox_client.request_ride( + response = authorized_rider_sandbox_client.request_ride( product_id=UFP_PRODUCT_ID, fare_id=UFP_FARE_ID, start_latitude=START_LAT, @@ -502,10 +577,10 @@ def test_request_ride(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_request_shared_ride(authorized_sandbox_client): +def test_request_shared_ride(authorized_rider_sandbox_client): """Test to request shared ride with access token.""" try: - response = authorized_sandbox_client.request_ride( + response = authorized_rider_sandbox_client.request_ride( product_id=UFP_SHARED_PRODUCT_ID, fare_id=UFP_SHARED_FARE_ID, seat_count=UFP_SHARED_SEAT_COUNT, @@ -521,9 +596,9 @@ def test_request_shared_ride(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_request_ride_with_no_default_product(authorized_sandbox_client): +def test_request_ride_with_no_default_product(authorized_rider_sandbox_client): """Test to request ride with no default product.""" - response = authorized_sandbox_client.request_ride( + response = authorized_rider_sandbox_client.request_ride( fare_id=UFP_FARE_ID, start_latitude=START_LAT, start_longitude=START_LNG, @@ -538,9 +613,9 @@ def test_request_ride_with_no_default_product(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_request_ride_with_places(authorized_sandbox_client): +def test_request_ride_with_places(authorized_rider_sandbox_client): """Test to request ride with place ids.""" - response = authorized_sandbox_client.request_ride( + response = authorized_rider_sandbox_client.request_ride( product_id=UFP_PRODUCT_ID, fare_id=UFP_FARE_ID, start_place_id='home', @@ -554,9 +629,9 @@ def test_request_ride_with_places(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_get_ride_details(authorized_sandbox_client): +def test_get_ride_details(authorized_rider_sandbox_client): """Test to fetch ride details with access token.""" - response = authorized_sandbox_client.get_ride_details(RIDE_ID) + response = authorized_rider_sandbox_client.get_ride_details(RIDE_ID) assert response.status_code == codes.ok # assert response looks like ride details @@ -566,9 +641,9 @@ def test_get_ride_details(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_get_current_ride_details(authorized_sandbox_client): +def test_get_current_ride_details(authorized_rider_sandbox_client): """Test to fetch current ride details with access token.""" - response = authorized_sandbox_client.get_current_ride_details() + response = authorized_rider_sandbox_client.get_current_ride_details() assert response.status_code == codes.ok # assert response looks like ride details @@ -578,9 +653,9 @@ def test_get_current_ride_details(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_get_current_shared_ride_details(authorized_sandbox_client): +def test_get_current_shared_ride_details(authorized_rider_sandbox_client): """Test to fetch current shared ride details with access token.""" - response = authorized_sandbox_client.get_current_ride_details() + response = authorized_rider_sandbox_client.get_current_ride_details() assert response.status_code == codes.ok # assert response looks like ride details @@ -590,9 +665,9 @@ def test_get_current_shared_ride_details(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_update_ride_destination(authorized_sandbox_client): +def test_update_ride_destination(authorized_rider_sandbox_client): """Test to update the trip destination.""" - response = authorized_sandbox_client.update_ride( + response = authorized_rider_sandbox_client.update_ride( RIDE_ID, end_latitude=UPDATE_LAT, end_longitude=UPDATE_LNG, @@ -601,9 +676,9 @@ def test_update_ride_destination(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_update_ride_destination_with_places(authorized_sandbox_client): +def test_update_ride_destination_with_places(authorized_rider_sandbox_client): """Test to update the trip destination with a place ID.""" - response = authorized_sandbox_client.update_ride( + response = authorized_rider_sandbox_client.update_ride( RIDE_ID, end_place_id='work', ) @@ -611,9 +686,9 @@ def test_update_ride_destination_with_places(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_get_ride_map(authorized_sandbox_client): +def test_get_ride_map(authorized_rider_sandbox_client): """Test to fetch ride map with access token.""" - response = authorized_sandbox_client.get_ride_map(RIDE_ID) + response = authorized_rider_sandbox_client.get_ride_map(RIDE_ID) assert response.status_code == codes.ok # assert response looks like map @@ -622,9 +697,9 @@ def test_get_ride_map(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_update_sandbox_ride(authorized_sandbox_client): +def test_update_sandbox_ride(authorized_rider_sandbox_client): """Test to update sandbox ride status with access token.""" - response = authorized_sandbox_client.update_sandbox_ride( + response = authorized_rider_sandbox_client.update_sandbox_ride( ride_id=RIDE_ID, new_status='accepted', ) @@ -632,23 +707,23 @@ def test_update_sandbox_ride(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_cancel_ride(authorized_sandbox_client): +def test_cancel_ride(authorized_rider_sandbox_client): """Test to cancel ride with access token.""" - response = authorized_sandbox_client.cancel_ride(RIDE_ID) + response = authorized_rider_sandbox_client.cancel_ride(RIDE_ID) assert response.status_code == codes.no_content @uber_vcr.use_cassette() -def test_cancel_current_ride(authorized_sandbox_client): +def test_cancel_current_ride(authorized_rider_sandbox_client): """Test to cancel the current ride with access token.""" - response = authorized_sandbox_client.cancel_current_ride() + response = authorized_rider_sandbox_client.cancel_current_ride() assert response.status_code == codes.no_content @uber_vcr.use_cassette() -def test_get_ride_receipt(authorized_sandbox_client): +def test_get_ride_receipt(authorized_rider_sandbox_client): """Test to fetch ride receipt with access token.""" - response = authorized_sandbox_client.get_ride_receipt(RIDE_ID) + response = authorized_rider_sandbox_client.get_ride_receipt(RIDE_ID) assert response.status_code == codes.ok # assert response looks like ride receipt @@ -661,9 +736,9 @@ def test_get_ride_receipt(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_update_sandbox_product(authorized_sandbox_client): +def test_update_sandbox_product(authorized_rider_sandbox_client): """Test to update sandbox ride status with access token.""" - response = authorized_sandbox_client.update_sandbox_product( + response = authorized_rider_sandbox_client.update_sandbox_product( product_id=NON_UFP_SURGE_PRODUCT_ID, surge_multiplier=2, ) @@ -671,10 +746,10 @@ def test_update_sandbox_product(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_request_ride_with_surge(authorized_sandbox_client): +def test_request_ride_with_surge(authorized_rider_sandbox_client): """Test raising a SurgeError when requesting a ride with surge.""" with raises(SurgeError): - authorized_sandbox_client.request_ride( + authorized_rider_sandbox_client.request_ride( product_id=NON_UFP_SURGE_PRODUCT_ID, start_latitude=NON_UFP_SURGE_START_LAT, start_longitude=NON_UFP_SURGE_START_LNG, @@ -705,9 +780,9 @@ def test_surge_error_formation(http_surge_error): @uber_vcr.use_cassette() -def test_set_home_address(authorized_sandbox_client): +def test_set_home_address(authorized_rider_sandbox_client): """Test to update a user's home address with an access token.""" - response = authorized_sandbox_client.set_home_address(HOME_ADDRESS) + response = authorized_rider_sandbox_client.set_home_address(HOME_ADDRESS) assert response.status_code == codes.ok # assert response looks like places details @@ -717,9 +792,9 @@ def test_set_home_address(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_get_home_address(authorized_sandbox_client): +def test_get_home_address(authorized_rider_sandbox_client): """Test to fetch a user's home address with an access token.""" - response = authorized_sandbox_client.get_home_address() + response = authorized_rider_sandbox_client.get_home_address() assert response.status_code == codes.ok # assert response looks like places details @@ -729,9 +804,9 @@ def test_get_home_address(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_set_work_address(authorized_sandbox_client): +def test_set_work_address(authorized_rider_sandbox_client): """Test to update a user's work address with an access token.""" - response = authorized_sandbox_client.set_work_address(WORK_ADDRESS) + response = authorized_rider_sandbox_client.set_work_address(WORK_ADDRESS) assert response.status_code == codes.ok # assert response looks like places details @@ -741,9 +816,9 @@ def test_set_work_address(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_get_work_address(authorized_sandbox_client): +def test_get_work_address(authorized_rider_sandbox_client): """Test to fetch a user's work address with an access token.""" - response = authorized_sandbox_client.get_work_address() + response = authorized_rider_sandbox_client.get_work_address() assert response.status_code == codes.ok # assert response looks like places details @@ -753,9 +828,9 @@ def test_get_work_address(authorized_sandbox_client): @uber_vcr.use_cassette() -def test_get_payment_methods(authorized_sandbox_client): +def test_get_payment_methods(authorized_rider_sandbox_client): """Test to get a list of payment methods with an access token.""" - response = authorized_sandbox_client.get_payment_methods() + response = authorized_rider_sandbox_client.get_payment_methods() assert response.status_code == codes.ok response = response.json @@ -763,3 +838,40 @@ def test_get_payment_methods(authorized_sandbox_client): for payment in payments: assert EXPECTED_PAYMENT_KEYS.issubset(payment) + + +@uber_vcr.use_cassette() +def test_get_driver_profile(authorized_driver_production_client): + """Test to fetch driver profile with access token.""" + response = authorized_driver_production_client.get_driver_profile() + assert response.status_code == codes.ok + + # assert response looks like driver profile + response = response.json + assert EXPECTED_DRIVER_PROFILE_KEYS.issubset(response) + + +@uber_vcr.use_cassette() +def test_get_driver_trips(authorized_driver_production_client): + """Test to fetch driver trips with access token.""" + response = authorized_driver_production_client.get_driver_trips() + assert response.status_code == codes.ok + + response = response.json + trips = response.get('trips') + + for trip in trips: + assert EXPECTED_DRIVER_TRIPS_KEYS.issubset(trip) + + +@uber_vcr.use_cassette() +def test_get_driver_payments(authorized_driver_production_client): + """Test to fetch driver payments with access token.""" + response = authorized_driver_production_client.get_driver_payments() + assert response.status_code == codes.ok + + response = response.json + payments = response.get('payments') + + for payment in payments: + assert EXPECTED_DRIVER_PAYMENTS_KEYS.issubset(payment) diff --git a/tests/test_errors.py b/tests/test_errors.py index 28ee77e..a6bb344 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/tests/test_request_utils.py b/tests/test_request_utils.py index a413956..3c5e045 100644 --- a/tests/test_request_utils.py +++ b/tests/test_request_utils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/tests/test_session.py b/tests/test_session.py index c8160da..55c51c5 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/tests/vcr_config.py b/tests/vcr_config.py index 8d73ccf..7ff6f16 100644 --- a/tests/vcr_config.py +++ b/tests/vcr_config.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/uber_rides/auth.py b/uber_rides/auth.py index 328f365..d0f2c28 100644 --- a/uber_rides/auth.py +++ b/uber_rides/auth.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/uber_rides/client.py b/uber_rides/client.py index a279c80..8ac4967 100644 --- a/uber_rides/client.py +++ b/uber_rides/client.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -456,9 +456,9 @@ def get_current_ride_details(self): """Get status details for an ongoing ride. This method behaves like get_ride_details by default (only returns - details about trips your app requested). If your app has the `all_trips` - scope, however, trip details will be returned for trips irrespective - of which application initiated them. + details about trips your app requested). If your app has the + `all_trips` scope, however, trip details will be returned for trips + irrespective of which application initiated them. Returns (Response) @@ -699,6 +699,92 @@ def revoke_oauth_credential(self): credential = self.session.oauth2credential revoke_access_token(credential) + def get_rider_profile(self): + """Get information about the authorized Uber user. + + Returns + (Response) + A Response object containing account information. + """ + return self.get_user_profile() + + def get_driver_profile(self): + """Get profile about the authorized Uber driver. + + Returns + (Response) + A Response object containing account information. + """ + return self._api_call('GET', 'v1/partners/me') + + def get_driver_trips(self, + offset=None, + limit=None, + from_time=None, + to_time=None + ): + """Get trips about the authorized Uber driver. + + Parameters + offset (int) + The integer offset for activity results. Offset the list of + returned results by this amount. Default is zero. + limit (int) + Integer amount of results to return. Number of items to + retrieve per page. Default is 10, maximum is 50. + from_time (int) + Unix timestamp of the start time to query. Queries starting + from the first trip if omitted. + to_time (int) + Unix timestamp of the end time to query. Queries starting + from the last trip if omitted. + + Returns + (Response) + A Response object containing trip information. + """ + args = { + 'offset': offset, + 'limit': limit, + 'from_time': from_time, + 'to_time': to_time, + } + return self._api_call('GET', 'v1/partners/trips', args=args) + + def get_driver_payments(self, + offset=None, + limit=None, + from_time=None, + to_time=None + ): + """Get payments about the authorized Uber driver. + + Parameters + offset (int) + The integer offset for activity results. Offset the list of + returned results by this amount. Default is zero. + limit (int) + Integer amount of results to return. Number of items to + retrieve per page. Default is 10, maximum is 50. + from_time (int) + Unix timestamp of the start time to query. Queries starting + from the first trip if omitted. + to_time (int) + Unix timestamp of the end time to query. Queries starting + from the last trip if omitted. + + Returns + (Response) + A Response object containing trip information. + """ + args = { + 'offset': offset, + 'limit': limit, + 'from_time': from_time, + 'to_time': to_time, + } + return self._api_call('GET', 'v1/partners/payments', args=args) + def surge_handler(response, **kwargs): """Error Handler to surface 409 Surge Conflict errors. @@ -713,11 +799,9 @@ def surge_handler(response, **kwargs): """ if response.status_code == codes.conflict: json = response.json() - # try to get errors, then the first, if so errors = json.get('errors', []) - error = errors[0] if errors else json.get('error') # might find an `error` key if `errors` was not there + error = errors[0] if errors else json.get('error') - # safe check in case `code` isn't present if error and error.get('code') == 'surge': raise SurgeError(response) diff --git a/uber_rides/errors.py b/uber_rides/errors.py index caae9e6..49e64fa 100644 --- a/uber_rides/errors.py +++ b/uber_rides/errors.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/uber_rides/request.py b/uber_rides/request.py index 8ba0282..cd8b02d 100644 --- a/uber_rides/request.py +++ b/uber_rides/request.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/uber_rides/session.py b/uber_rides/session.py index 87857ad..5a31fc9 100644 --- a/uber_rides/session.py +++ b/uber_rides/session.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/uber_rides/utils/auth.py b/uber_rides/utils/auth.py index 643acbe..9cbba29 100644 --- a/uber_rides/utils/auth.py +++ b/uber_rides/utils/auth.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/uber_rides/utils/handlers.py b/uber_rides/utils/handlers.py index 0f6895b..a0baa2b 100644 --- a/uber_rides/utils/handlers.py +++ b/uber_rides/utils/handlers.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/uber_rides/utils/http.py b/uber_rides/utils/http.py index 62a116b..58f44d7 100644 --- a/uber_rides/utils/http.py +++ b/uber_rides/utils/http.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/uber_rides/utils/request.py b/uber_rides/utils/request.py index 403dbde..4ecee7e 100644 --- a/uber_rides/utils/request.py +++ b/uber_rides/utils/request.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Uber Technologies, Inc. +# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal