Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add two new types of exceptions (issue #152)
- Loading branch information
Showing
6 changed files
with
102 additions
and
6 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
11 changes: 11 additions & 0 deletions
11
github/tests/ReplayData/SpecificExceptions.testBadUserAgent.txt
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,11 @@ | ||
https | ||
GET | ||
api.github.com | ||
None | ||
/user | ||
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': ''} | ||
null | ||
403 | ||
[('date', 'Fri, 17 May 2013 12:16:34 GMT'), ('content-length', '107'), ('content-type', 'application/octet-stream'), ('connection', 'keep-alive'), ('server', 'GitHub.com')] | ||
{"message":"Missing or invalid User Agent string. See http://developer.github.com/v3/#user-agent-required"} | ||
|
55 changes: 55 additions & 0 deletions
55
github/tests/ReplayData/SpecificExceptions.testRateLimitExceeded.txt
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,55 @@ | ||
https | ||
GET | ||
api.github.com | ||
None | ||
/users/jacquev6 | ||
{'User-Agent': 'PyGithub/Python'} | ||
null | ||
200 | ||
[('status', '200 OK'), ('x-ratelimit-remaining', '2'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Accept-Encoding'), ('content-length', '1299'), ('server', 'GitHub.com'), ('last-modified', 'Fri, 17 May 2013 12:09:51 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '60'), ('etag', '"de9347ae9c0c83b44d6c81d05aba4877"'), ('cache-control', 'public, max-age=60, s-maxage=60'), ('date', 'Fri, 17 May 2013 12:23:52 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8')] | ||
{"login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","name":"Vincent Jacques","company":"Criteo","blog":"http://vincent-jacques.net","location":"Paris, France","email":"vincent@vincent-jacques.net","hireable":false,"bio":"","public_repos":16,"followers":27,"following":39,"created_at":"2010-07-09T06:10:06Z","updated_at":"2013-05-17T12:09:51Z","public_gists":3} | ||
|
||
https | ||
GET | ||
api.github.com | ||
None | ||
/users/jacquev6 | ||
{'User-Agent': 'PyGithub/Python'} | ||
null | ||
200 | ||
[('status', '200 OK'), ('x-ratelimit-remaining', '1'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Accept-Encoding'), ('content-length', '1299'), ('server', 'GitHub.com'), ('last-modified', 'Fri, 17 May 2013 12:09:51 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '60'), ('etag', '"de9347ae9c0c83b44d6c81d05aba4877"'), ('cache-control', 'public, max-age=60, s-maxage=60'), ('date', 'Fri, 17 May 2013 12:23:53 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8')] | ||
{"login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","name":"Vincent Jacques","company":"Criteo","blog":"http://vincent-jacques.net","location":"Paris, France","email":"vincent@vincent-jacques.net","hireable":false,"bio":"","public_repos":16,"followers":27,"following":39,"created_at":"2010-07-09T06:10:06Z","updated_at":"2013-05-17T12:09:51Z","public_gists":3} | ||
|
||
https | ||
GET | ||
api.github.com | ||
None | ||
/users/jacquev6 | ||
{'User-Agent': 'PyGithub/Python'} | ||
null | ||
200 | ||
[('status', '200 OK'), ('x-ratelimit-remaining', '0'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Accept-Encoding'), ('content-length', '1299'), ('server', 'GitHub.com'), ('last-modified', 'Fri, 17 May 2013 12:09:51 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '60'), ('etag', '"de9347ae9c0c83b44d6c81d05aba4877"'), ('cache-control', 'public, max-age=60, s-maxage=60'), ('date', 'Fri, 17 May 2013 12:23:54 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8')] | ||
{"login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","name":"Vincent Jacques","company":"Criteo","blog":"http://vincent-jacques.net","location":"Paris, France","email":"vincent@vincent-jacques.net","hireable":false,"bio":"","public_repos":16,"followers":27,"following":39,"created_at":"2010-07-09T06:10:06Z","updated_at":"2013-05-17T12:09:51Z","public_gists":3} | ||
|
||
https | ||
GET | ||
api.github.com | ||
None | ||
/users/jacquev6 | ||
{'User-Agent': 'PyGithub/Python'} | ||
null | ||
200 | ||
[('status', '200 OK'), ('x-ratelimit-remaining', '0'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Accept-Encoding'), ('content-length', '1299'), ('server', 'GitHub.com'), ('last-modified', 'Fri, 17 May 2013 12:09:51 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '60'), ('etag', '"de9347ae9c0c83b44d6c81d05aba4877"'), ('cache-control', 'public, max-age=60, s-maxage=60'), ('date', 'Fri, 17 May 2013 12:23:55 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8')] | ||
{"login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","name":"Vincent Jacques","company":"Criteo","blog":"http://vincent-jacques.net","location":"Paris, France","email":"vincent@vincent-jacques.net","hireable":false,"bio":"","public_repos":16,"followers":27,"following":39,"created_at":"2010-07-09T06:10:06Z","updated_at":"2013-05-17T12:09:51Z","public_gists":3} | ||
|
||
https | ||
GET | ||
api.github.com | ||
None | ||
/users/jacquev6 | ||
{'User-Agent': 'PyGithub/Python'} | ||
null | ||
403 | ||
[('status', '403 Forbidden'), ('x-ratelimit-remaining', '0'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('content-length', '56'), ('server', 'GitHub.com'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '60'), ('access-control-allow-credentials', 'true'), ('date', 'Fri, 17 May 2013 12:23:56 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8')] | ||
{"message":"API Rate Limit Exceeded for 92.104.200.119"} | ||
|