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

Method testGetAuthenticatedApp

tests/GithubApp.py:128–171  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

126 self.assertIsNone(app.webhook_secret)
127
128 def testGetAuthenticatedApp(self):
129 auth = github.Auth.AppAuth(APP_ID, PRIVATE_KEY)
130 g = github.Github(auth=auth)
131
132 with self.assertWarns(DeprecationWarning) as warning:
133 # httpretty has some deprecation warnings in Python 3.12
134 with self.ignoreWarning(category=DeprecationWarning, module="httpretty"):
135 app = g.get_app()
136
137 self.assertWarning(
138 warning,
139 "Argument slug is mandatory, calling this method without the slug argument is deprecated, "
140 "please use github.GithubIntegration(auth=github.Auth.AppAuth(...)).get_app() instead",
141 )
142
143 self.assertEqual(app.created_at, datetime(2020, 8, 1, 17, 23, 46, tzinfo=timezone.utc))
144 self.assertEqual(app.description, "Sample App to test PyGithub")
145 self.assertListEqual(
146 app.events,
147 ["check_run", "check_suite", "label", "member", "public"],
148 )
149 self.assertEqual(app.external_url, "https://pygithub.readthedocs.io")
150 self.assertEqual(app.html_url, "https://github.com/apps/pygithubtest")
151 self.assertEqual(app.id, 75269)
152 self.assertEqual(app.name, "PyGithubTest")
153 self.assertEqual(app.owner.login, "wrecker")
154 self.assertDictEqual(
155 app.permissions,
156 {
157 "actions": "write",
158 "checks": "write",
159 "keys": "read",
160 "members": "read",
161 "metadata": "read",
162 "packages": "read",
163 "pages": "read",
164 "repository_hooks": "write",
165 "vulnerability_alerts": "read",
166 "workflows": "write",
167 },
168 )
169 self.assertEqual(app.slug, "pygithubtest")
170 self.assertEqual(app.updated_at, datetime(2020, 8, 1, 17, 44, 31, tzinfo=timezone.utc))
171 self.assertEqual(app.url, "/apps/pygithubtest")

Callers

nothing calls this directly

Calls 3

get_appMethod · 0.95
ignoreWarningMethod · 0.80
assertWarningMethod · 0.80

Tested by

no test coverage detected