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

Method testEnterpriseLoginURL

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

Source from the content-addressed store, hash-verified

94 self.assertEqual(gh_w_port, "my.enterprise.com:443")
95
96 def testEnterpriseLoginURL(self):
97 BASE_URL = "http://my.enterprise.com/login/oauth/authorize"
98 sample_uri = "https://myapp.com/some/path"
99 sample_uri_encoded = "https%3A%2F%2Fmyapp.com%2Fsome%2Fpath"
100 self.assertEqual(self.ent_app.get_login_url(), f"{BASE_URL}?client_id={self.CLIENT_ID}")
101 self.assertTrue(f"redirect_uri={sample_uri_encoded}" in self.ent_app.get_login_url(redirect_uri=sample_uri))
102 self.assertTrue(f"client_id={self.CLIENT_ID}" in self.ent_app.get_login_url(redirect_uri=sample_uri))
103 self.assertTrue("state=123abc" in self.ent_app.get_login_url(state="123abc", login="user"))
104 self.assertTrue("login=user" in self.ent_app.get_login_url(state="123abc", login="user"))
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")

Callers

nothing calls this directly

Calls 1

get_login_urlMethod · 0.80

Tested by

no test coverage detected