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

Method testEnterpriseGetAccessToken

tests/ApplicationOAuth.py:107–122  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

105 self.assertTrue(f"client_id={self.CLIENT_ID}" in self.ent_app.get_login_url(state="123abc", login="user"))
106
107 def testEnterpriseGetAccessToken(self):
108 access_token = self.ent_app.get_access_token("oauth_code_removed", state="state_removed")
109 # Test string representation
110 self.assertEqual(
111 str(access_token),
112 'AccessToken(type="bearer", token="acces...", scope="", '
113 "refresh_token_expires_in=None, refresh_token=None, expires_in=None)",
114 )
115 self.assertEqual(access_token.token, "access_token_removed")
116 self.assertEqual(access_token.type, "bearer")
117 self.assertEqual(access_token.scope, "")
118 self.assertIsNone(access_token.expires_in)
119 self.assertIsNone(access_token.expires_at)
120 self.assertIsNone(access_token.refresh_token)
121 self.assertIsNone(access_token.refresh_expires_in)
122 self.assertIsNone(access_token.refresh_expires_at)
123
124 def testGetAccessTokenWithExpiry(self):
125 with mock.patch("github.AccessToken.datetime") as dt:

Callers

nothing calls this directly

Calls 1

get_access_tokenMethod · 0.45

Tested by

no test coverage detected