(self)
| 125 | self.assertLogging("GET", url, requestHeaders, responseHeaders, output) |
| 126 | |
| 127 | def testLoggingWithOAuthAuthentication(self): |
| 128 | self.assertEqual(github.Github(auth=self.oauth_token).get_user().name, "Vincent Jacques") |
| 129 | url = "https://api.github.com/user" |
| 130 | requestHeaders = { |
| 131 | "Authorization": "token (oauth token removed)", |
| 132 | "User-Agent": "PyGithub/Python", |
| 133 | } |
| 134 | responseHeaders = { |
| 135 | "status": "200 OK", |
| 136 | "x-ratelimit-remaining": "4993", |
| 137 | "x-github-media-type": "github.beta; format=json", |
| 138 | "x-content-type-options": "nosniff", |
| 139 | "vary": "Accept, Authorization, Cookie", |
| 140 | "content-length": "628", |
| 141 | "server": "nginx", |
| 142 | "last-modified": "Tue, 25 Sep 2012 07:42:42 GMT", |
| 143 | "connection": "keep-alive", |
| 144 | "x-ratelimit-limit": "5000", |
| 145 | "etag": '"c23ad6b5815fc3d6ec6341c4a47afe85"', |
| 146 | "cache-control": "private, max-age=60, s-maxage=60", |
| 147 | "date": "Tue, 25 Sep 2012 20:36:54 GMT", |
| 148 | "x-oauth-scopes": "", |
| 149 | "content-type": "application/json; charset=utf-8", |
| 150 | "x-accepted-oauth-scopes": "user", |
| 151 | "DEBUG_FRAME": 0, |
| 152 | } |
| 153 | output = '{"type":"User","bio":"","html_url":"https://github.com/jacquev6","login":"jacquev6","followers":14,"company":"Criteo","blog":"http://vincent-jacques.net","public_repos":13,"created_at":"2010-07-09T06:10:06Z","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","email":"vincent@vincent-jacques.net","following":29,"name":"Vincent Jacques","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","hireable":false,"id":327146,"public_gists":3,"location":"Paris, France","url":"https://api.github.com/users/jacquev6"}' |
| 154 | self.assertLogging("GET", url, requestHeaders, responseHeaders, output) |
| 155 | |
| 156 | def testLoggingWithoutAuthentication(self): |
| 157 | self.assertEqual(github.Github().get_user("jacquev6").name, "Vincent Jacques") |
nothing calls this directly
no test coverage detected