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

Method testLoginURL

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

Source from the content-addressed store, hash-verified

55 self.ent_app = self.ent_gh.get_oauth_application(self.CLIENT_ID, self.CLIENT_SECRET)
56
57 def testLoginURL(self):
58 BASE_URL = "https://github.com/login/oauth/authorize"
59 sample_uri = "https://myapp.com/some/path"
60 sample_uri_encoded = "https%3A%2F%2Fmyapp.com%2Fsome%2Fpath"
61 self.assertEqual(self.app.get_login_url(), f"{BASE_URL}?client_id={self.CLIENT_ID}")
62 self.assertTrue(f"redirect_uri={sample_uri_encoded}" in self.app.get_login_url(redirect_uri=sample_uri))
63 self.assertTrue(f"client_id={self.CLIENT_ID}" in self.app.get_login_url(redirect_uri=sample_uri))
64 self.assertTrue("state=123abc" in self.app.get_login_url(state="123abc", login="user"))
65 self.assertTrue("login=user" in self.app.get_login_url(state="123abc", login="user"))
66 self.assertTrue(f"client_id={self.CLIENT_ID}" in self.app.get_login_url(state="123abc", login="user"))
67
68 def testGetAccessToken(self):
69 access_token = self.app.get_access_token("oauth_code_removed", state="state_removed")

Callers

nothing calls this directly

Calls 1

get_login_urlMethod · 0.80

Tested by

no test coverage detected