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

Method testNetrcAuthFails

tests/Authentication.py:287–295  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

285 self.assertEqual(auth.token_type, "Basic")
286
287 def testNetrcAuthFails(self):
288 # provide an empty netrc file to make sure this test does not find one
289 with NamedTemporaryFile("wt", delete=False) as tmp:
290 tmp.close()
291 auth = github.Auth.NetrcAuth()
292 with mock.patch.dict(os.environ, {"NETRC": tmp.name}):
293 with self.assertRaises(RuntimeError) as exc:
294 github.Github(auth=auth)
295 self.assertEqual(exc.exception.args, ("Could not get credentials from netrc for host api.github.com",))
296
297 def testCreateJWT(self):
298 auth = github.Auth.AppAuth(APP_ID, PRIVATE_KEY)

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected