-
-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #733 from nmtake/live-now
Add LiveHelper.now
- Loading branch information
Showing
7 changed files
with
142 additions
and
0 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
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
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
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
108 changes: 108 additions & 0 deletions
108
tests/integration/cassettes/TestReddit.test_live_now__no_featured.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,108 @@ | ||
{ | ||
"http_interactions": [ | ||
{ | ||
"recorded_at": "2017-02-16T16:11:04", | ||
"request": { | ||
"body": { | ||
"encoding": "utf-8", | ||
"string": "grant_type=client_credentials" | ||
}, | ||
"headers": { | ||
"Accept": "*/*", | ||
"Accept-Encoding": "identity", | ||
"Authorization": "Basic <BASIC_AUTH>", | ||
"Connection": "keep-alive", | ||
"Content-Length": "29", | ||
"Content-Type": "application/x-www-form-urlencoded", | ||
"User-Agent": "<USER_AGENT> PRAW/4.3.1.dev0 prawcore/0.8.0" | ||
}, | ||
"method": "POST", | ||
"uri": "https://www.reddit.com/api/v1/access_token" | ||
}, | ||
"response": { | ||
"body": { | ||
"encoding": "UTF-8", | ||
"string": "{\"access_token\": \"<ACCESS_TOKEN>\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"scope\": \"*\"}" | ||
}, | ||
"headers": { | ||
"Accept-Ranges": "bytes", | ||
"Connection": "keep-alive", | ||
"Content-Length": "105", | ||
"Content-Type": "application/json; charset=UTF-8", | ||
"Date": "Thu, 16 Feb 2017 16:11:07 GMT", | ||
"Server": "snooserv", | ||
"Set-Cookie": "loid=dzEJwqV1Xbmbp1TxVQ; Domain=reddit.com; Max-Age=63071999; Path=/; secure", | ||
"Strict-Transport-Security": "max-age=15552000; includeSubDomains; preload", | ||
"Via": "1.1 varnish", | ||
"X-Cache": "MISS", | ||
"X-Cache-Hits": "0", | ||
"X-Moose": "majestic", | ||
"X-Served-By": "cache-nrt6129-NRT", | ||
"X-Timer": "S1487261467.715573,VS0,VE198", | ||
"cache-control": "max-age=0, must-revalidate", | ||
"x-content-type-options": "nosniff", | ||
"x-frame-options": "SAMEORIGIN", | ||
"x-xss-protection": "1; mode=block" | ||
}, | ||
"status": { | ||
"code": 200, | ||
"message": "OK" | ||
}, | ||
"url": "https://www.reddit.com/api/v1/access_token" | ||
} | ||
}, | ||
{ | ||
"recorded_at": "2017-02-16T16:11:04", | ||
"request": { | ||
"body": { | ||
"encoding": "utf-8", | ||
"string": "" | ||
}, | ||
"headers": { | ||
"Accept": "*/*", | ||
"Accept-Encoding": "identity", | ||
"Authorization": "bearer <ACCESS_TOKEN>", | ||
"Connection": "keep-alive", | ||
"Cookie": "loid=dzEJwqV1Xbmbp1TxVQ; loidcreated=1487261467000", | ||
"User-Agent": "<USER_AGENT> PRAW/4.3.1.dev0 prawcore/0.8.0" | ||
}, | ||
"method": "GET", | ||
"uri": "https://oauth.reddit.com/api/live/happening_now?raw_json=1" | ||
}, | ||
"response": { | ||
"body": { | ||
"encoding": "UTF-8", | ||
"string": "" | ||
}, | ||
"headers": { | ||
"Accept-Ranges": "bytes", | ||
"Connection": "keep-alive", | ||
"Content-Type": "application/json; charset=UTF-8", | ||
"Date": "Thu, 16 Feb 2017 16:11:08 GMT", | ||
"Server": "snooserv", | ||
"Strict-Transport-Security": "max-age=15552000; includeSubDomains; preload", | ||
"Via": "1.1 varnish", | ||
"X-Cache": "MISS", | ||
"X-Cache-Hits": "0", | ||
"X-Moose": "majestic", | ||
"X-Served-By": "cache-nrt6134-NRT", | ||
"X-Timer": "S1487261468.054475,VS0,VE182", | ||
"access-control-allow-origin": "*", | ||
"access-control-expose-headers": "X-Reddit-Tracking, X-Moose", | ||
"cache-control": "max-age=0, must-revalidate", | ||
"x-content-type-options": "nosniff", | ||
"x-frame-options": "SAMEORIGIN", | ||
"x-reddit-tracking": "https://pixel.redditmedia.com/pixel/of_destiny.png?v=YcwQRLyZ%2FuT7JwqZptyf4PztjeDdfFxNougyY9av%2FH%2B26sw7qFkqskiV4emqCNcSfDoOKBcPHnOFNkTAa4tO9giGNShdTHde", | ||
"x-ua-compatible": "IE=edge", | ||
"x-xss-protection": "1; mode=block" | ||
}, | ||
"status": { | ||
"code": 204, | ||
"message": "No Content" | ||
}, | ||
"url": "https://oauth.reddit.com/api/live/happening_now?raw_json=1" | ||
} | ||
} | ||
], | ||
"recorded_with": "betamax/0.8.0" | ||
} |
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
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,7 @@ | ||
from . import UnitTest | ||
|
||
|
||
class TestObjector(UnitTest): | ||
|
||
def test_objectify_returns_None_for_None(self): | ||
assert self.reddit._objector.objectify(None) is None |