MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / testLoggingWithBaseUrl

Method testLoggingWithBaseUrl

tests/Logging_.py:180–206  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

178 self.assertLogging("GET", url, requestHeaders, responseHeaders, output)
179
180 def testLoggingWithBaseUrl(self):
181 # ReplayData forged, not recorded
182 self.assertEqual(
183 github.Github(base_url="http://my.enterprise.com/my/prefix").get_user("jacquev6").name,
184 "Vincent Jacques",
185 )
186 url = "http://my.enterprise.com/my/prefix/users/jacquev6"
187 requestHeaders = {"User-Agent": "PyGithub/Python"}
188 responseHeaders = {
189 "status": "200 OK",
190 "content-length": "628",
191 "x-github-media-type": "github.beta; format=json",
192 "x-content-type-options": "nosniff",
193 "x-ratelimit-limit": "5000",
194 "vary": "Accept",
195 "x-ratelimit-remaining": "4989",
196 "server": "nginx",
197 "last-modified": "Tue, 25 Sep 2012 07:42:42 GMT",
198 "connection": "keep-alive",
199 "etag": '"9bd085221a16b6d2ea95e72634c3c1ac"',
200 "cache-control": "public, max-age=60, s-maxage=60",
201 "date": "Tue, 25 Sep 2012 20:38:56 GMT",
202 "content-type": "application/json; charset=utf-8",
203 "DEBUG_FRAME": 0,
204 }
205 output = '{"type":"User","html_url":"https://github.com/jacquev6","login":"jacquev6","followers":14,"company":"Criteo","created_at":"2010-07-09T06:10:06Z","email":"vincent@vincent-jacques.net","hireable":false,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","public_gists":3,"bio":"","following":29,"name":"Vincent Jacques","blog":"http://vincent-jacques.net","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"public_repos":13,"location":"Paris, France","url":"https://api.github.com/users/jacquev6"}'
206 self.assertLogging("GET", url, requestHeaders, responseHeaders, output)
207
208 def testLoggingDoesNotModifyRequestHeaders(self):
209 # Recorded replay data already sanitizes Authorization headers, so we

Callers

nothing calls this directly

Calls 2

assertLoggingMethod · 0.95
get_userMethod · 0.80

Tested by

no test coverage detected