-
-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add betamax support for OAuth2Tests.
- Loading branch information
Showing
23 changed files
with
46 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/fixtures/cassettes/test_get_access_information_with_invalid_code.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"http_interactions": [{"request": {"body": {"string": "redirect_uri=https%3A%2F%2F127.0.0.1%3A65010%2Fauthorize_callback&code=invalid_code&grant_type=authorization_code", "encoding": "utf-8"}, "headers": {"Content-Length": ["113"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "User-Agent": ["PRAW_test_suite PRAW/2.1.21 Python/2.7.5 Darwin-13.4.0-x86_64-i386-64bit"], "Connection": ["keep-alive"], "Content-Type": ["application/x-www-form-urlencoded"], "Authorization": ["Basic c3RKbFVTVWJQUWU1bFE6aVUtTHNPenlKSDdCRFZvcS1xT1dORXEyenVJ"]}, "method": "POST", "uri": "https://ssl.reddit.com/api/v1/access_token/"}, "response": {"body": {"string": "{\"error\": \"invalid_grant\"}", "encoding": "UTF-8"}, "headers": {"content-length": ["26"], "x-xss-protection": ["1; mode=block"], "x-content-type-options": ["nosniff"], "set-cookie": ["__cfduid=d537c4d7cb46f1cf1de5bfef92e2f7b051428737839; expires=Sun, 10-Apr-16 07:37:19 GMT; path=/; domain=.reddit.com; HttpOnly"], "vary": ["Accept-Encoding"], "server": ["cloudflare-nginx"], "connection": ["keep-alive"], "cache-control": ["no-cache"], "date": ["Sat, 11 Apr 2015 07:37:20 GMT"], "x-frame-options": ["SAMEORIGIN"], "x-moose": ["majestic"], "content-type": ["application/json; charset=UTF-8"], "cf-ray": ["1d55068a542b0651-SJC"]}, "status": {"message": "OK", "code": 200}, "url": "https://ssl.reddit.com/api/v1/access_token/"}, "recorded_at": "2015-04-11T07:37:30"}], "recorded_with": "betamax/0.4.1"} |
1 change: 1 addition & 0 deletions
1
tests/fixtures/cassettes/test_invalid_set_access_credentials.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"http_interactions": [{"request": {"body": {"string": "", "encoding": "utf-8"}, "headers": {"Accept": ["*/*"], "Connection": ["keep-alive"], "Accept-Encoding": ["gzip, deflate"], "Authorization": ["bearer dummy_access_token"], "User-Agent": ["PRAW_test_suite PRAW/2.1.21 Python/2.7.5 Darwin-13.4.0-x86_64-i386-64bit"]}, "method": "GET", "uri": "https://oauth.reddit.com/api/v1/me.json"}, "response": {"body": {"string": "{\"error\": 401}", "encoding": "UTF-8"}, "headers": {"content-length": ["14"], "x-xss-protection": ["1; mode=block"], "x-reddit-tracking": ["https://pixel.redditmedia.com/pixel/of_destiny.png?v=S6xb7zlYHQbrG2NKJVD5hnxmKae%2F%2BxH%2Bqn1dYu7DjKYdgAewxQW92e6EA9QOiM%2FTk6%2Bli6PcJOQ%3D"], "x-content-type-options": ["nosniff"], "access-control-expose-headers": ["X-Reddit-Tracking, X-Moose"], "set-cookie": ["__cfduid=d638df043cba862b2f61081f00642930b1428737934; expires=Sun, 10-Apr-16 07:38:54 GMT; path=/; domain=.reddit.com; HttpOnly"], "www-authenticate": ["Bearer realm=\"reddit\", error=\"invalid_token\""], "server": ["cloudflare-nginx"], "connection": ["keep-alive"], "x-ua-compatible": ["IE=edge"], "cache-control": ["no-cache"], "date": ["Sat, 11 Apr 2015 07:38:54 GMT"], "x-frame-options": ["SAMEORIGIN"], "access-control-allow-origin": ["*"], "x-moose": ["majestic"], "content-type": ["application/json; charset=UTF-8"], "cf-ray": ["1d5508db56300da3-SJC"]}, "status": {"message": "Unauthorized", "code": 401}, "url": "https://oauth.reddit.com/api/v1/me.json"}, "recorded_at": "2015-04-11T07:39:05"}], "recorded_with": "betamax/0.4.1"} |
1 change: 1 addition & 0 deletions
1
tests/fixtures/cassettes/test_oauth_without_identy_doesnt_set_user.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"http_interactions": [{"request": {"body": {"string": "grant_type=refresh_token&refresh_token=FFx_0G7Zumyh4AWzIo39bG9KdIM&redirect_uri=https%3A%2F%2F127.0.0.1%3A65010%2Fauthorize_callback", "encoding": "utf-8"}, "headers": {"Content-Length": ["132"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "User-Agent": ["PRAW_test_suite PRAW/2.1.21 Python/2.7.5 Darwin-13.4.0-x86_64-i386-64bit"], "Connection": ["keep-alive"], "Content-Type": ["application/x-www-form-urlencoded"], "Authorization": ["Basic c3RKbFVTVWJQUWU1bFE6aVUtTHNPenlKSDdCRFZvcS1xT1dORXEyenVJ"]}, "method": "POST", "uri": "https://ssl.reddit.com/api/v1/access_token/"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA6tWSkxOTi0uji/Jz07NU7JSUDI3NjCyMDPXLauMDDT3yTWuyq2MqAp2tgg3yzCNiHBN9MqLVNJRUAKrjy+pLEgFaUpKTSxKLQKJp1YUZBalFsdnggwzNjMw0FFQKk7OhyhLTcksUaoFAJ/oLAt0AAAA", "encoding": "UTF-8"}, "headers": {"x-xss-protection": ["1; mode=block"], "x-content-type-options": ["nosniff"], "content-encoding": ["gzip"], "transfer-encoding": ["chunked"], "set-cookie": ["__cfduid=de18fffd5cf3ff8305436d90d608a4f781428738079; expires=Sun, 10-Apr-16 07:41:19 GMT; path=/; domain=.reddit.com; HttpOnly"], "vary": ["Accept-Encoding"], "server": ["cloudflare-nginx"], "connection": ["keep-alive"], "cache-control": ["no-cache"], "date": ["Sat, 11 Apr 2015 07:41:19 GMT"], "x-frame-options": ["SAMEORIGIN"], "x-moose": ["majestic"], "content-type": ["application/json; charset=UTF-8"], "cf-ray": ["1d550c6289681219-SJC"]}, "status": {"message": "OK", "code": 200}, "url": "https://ssl.reddit.com/api/v1/access_token/"}, "recorded_at": "2015-04-11T07:41:29"}], "recorded_with": "betamax/0.4.1"} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"http_interactions": [{"request": {"body": {"string": "grant_type=refresh_token&refresh_token=FFx_0G7Zumyh4AWzIo39bG9KdIM&redirect_uri=https%3A%2F%2F127.0.0.1%3A65010%2Fauthorize_callback", "encoding": "utf-8"}, "headers": {"Content-Length": ["132"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "User-Agent": ["PRAW_test_suite PRAW/2.1.21 Python/2.7.5 Darwin-13.4.0-x86_64-i386-64bit"], "Connection": ["keep-alive"], "Content-Type": ["application/x-www-form-urlencoded"], "Authorization": ["Basic c3RKbFVTVWJQUWU1bFE6aVUtTHNPenlKSDdCRFZvcS1xT1dORXEyenVJ"]}, "method": "POST", "uri": "https://ssl.reddit.com/api/v1/access_token/"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA6tWSkxOTi0uji/Jz07NU7JSUDI3NjCyMDPXNU9zdS6pDCh1Ti4t9jI0yk+NsghISywz8i+1UNJRUAKrjy+pLEgFaUpKTSxKLQKJp1YUZBalFsdnggwzNjMw0FFQKk7OhyhLTcksUaoFAE8drFZ0AAAA", "encoding": "UTF-8"}, "headers": {"x-xss-protection": ["1; mode=block"], "x-content-type-options": ["nosniff"], "content-encoding": ["gzip"], "transfer-encoding": ["chunked"], "set-cookie": ["__cfduid=de7a8082d1b018149be421b5c079691ae1428737957; expires=Sun, 10-Apr-16 07:39:17 GMT; path=/; domain=.reddit.com; HttpOnly"], "vary": ["Accept-Encoding"], "server": ["cloudflare-nginx"], "connection": ["keep-alive"], "cache-control": ["no-cache"], "date": ["Sat, 11 Apr 2015 07:39:18 GMT"], "x-frame-options": ["SAMEORIGIN"], "x-moose": ["majestic"], "content-type": ["application/json; charset=UTF-8"], "cf-ray": ["1d55096d18770d73-SJC"]}, "status": {"message": "OK", "code": 200}, "url": "https://ssl.reddit.com/api/v1/access_token/"}, "recorded_at": "2015-04-11T07:39:28"}, {"request": {"body": {"string": "text=Edited+text&thing_id=t3_16i92b&api_type=json", "encoding": "utf-8"}, "headers": {"Content-Length": ["49"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "User-Agent": ["PRAW_test_suite PRAW/2.1.21 Python/2.7.5 Darwin-13.4.0-x86_64-i386-64bit"], "Connection": ["keep-alive"], "Content-Type": ["application/x-www-form-urlencoded"], "Authorization": ["bearer 7302867-7fECtyPuCcusJ12oeZ8Pfav2Ou8"]}, "method": "POST", "uri": "https://oauth.reddit.com/api/editusertext/.json"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA2yRy07DMBBFf8V40VXKo0hItGKBEJXYQCVgRZHlxNNmiB/R2ImoIv4djWlKF92N71yfOx4P8isGL+dikEAUKMq5+PgshDQ66SynGv02y4Ns0Bs5FzJdy2OLCU4jQ2QEuzknMAaT0i2qBDGxtdTeg1Hljk2r3f3q6Q1ieo9AM247MKgVuBIYP/wUQsau/OPwjRNETkrwnVSdnGXPxKbF2XQqXh/Uy3IpptPJNi1YNNiLyuoY79bSmbUc9ZaLR4MJjGASaxdZXPtcG+xH7wh+3nOPJ+DwIwy3LDbAK/OdtYWQXQRSBG2gdNhvhKojUPnl/06LvlEbq5HUHr1vYN771Q3ezkpO2KI1eVmXhZCaqhr7fEzUQSFkZbFqsrDRNrLyF68IdAz+MIXuUh3o9Kf4zqkqOAc+T81BsQoEY2jbUujB/AIAAP//nJNBboMwEEWvEuUAcYCSkOxygi66riwDbhm1jpE9DivfvZoxFoSqm+6Qx2j+f/87hTrLtA/tZNGs9g7Q95q6kQ9wCKa9K+DQmGNOWiaTWMsSa3uimWau++uueCmbc3W+1JcDLV9x6ryXHO+iIrn6e97biRGwpVUOmwaqhDQL9wjdFzwdgZfUgoX7qJ1RJI6MCCc2xRWZp0hJCktSpQ+tARQMXRkCvMdKLmF3TqsZQ1U3xbE5nkrGEBxTHBDHqxDTNM1v79BZ85/tT+Bytz+sbZWjMQJ+s7rXW8Bh98Y/rgTKgN1vkT14hPtnAD+whzmETfON7bdP5AF+Tj/zpkoul5jAyF8xvscYfwAAAP//AwAbfw38zQQAAA==", "encoding": "UTF-8"}, "headers": {"x-ratelimit-remaining": ["514.0"], "x-xss-protection": ["1; mode=block"], "x-content-type-options": ["nosniff"], "content-encoding": ["gzip"], "transfer-encoding": ["chunked"], "set-cookie": ["__cfduid=d89970b14a22ab08edf4847f87ee2c3681428737958; expires=Sun, 10-Apr-16 07:39:18 GMT; path=/; domain=.reddit.com; HttpOnly"], "vary": ["accept-encoding"], "server": ["cloudflare-nginx"], "connection": ["keep-alive"], "x-ua-compatible": ["IE=edge"], "pragma": ["no-cache"], "cache-control": ["no-cache, no-cache"], "date": ["Sat, 11 Apr 2015 07:39:19 GMT"], "x-frame-options": ["SAMEORIGIN"], "x-moose": ["majestic"], "content-type": ["application/json; charset=UTF-8"], "cf-ray": ["1d550971e904012c-SJC"], "x-ratelimit-used": ["86"], "x-ratelimit-reset": ["41"]}, "status": {"message": "OK", "code": 200}, "url": "https://oauth.reddit.com/api/editusertext/.json"}, "recorded_at": "2015-04-11T07:39:29"}], "recorded_with": "betamax/0.4.1"} |
Oops, something went wrong.