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

Method setUp

tests/Framework.py:451–487  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

449 self.seconds_between_writes: float | None = None
450
451 def setUp(self):
452 super().setUp()
453 self.__customFilename: str | None = None
454 self.__fileName = ""
455 self.__file = None
456 if (
457 self.recordMode
458 ): # pragma no cover (Branch useful only when recording new tests, not used during automated tests)
459 RecordingHttpConnection.setOpenFile(self.__openFile)
460 RecordingHttpsConnection.setOpenFile(self.__openFile)
461 github.Requester.Requester.injectConnectionClasses(
462 RecordingHttpConnection,
463 RecordingHttpsConnection,
464 )
465 import GithubCredentials # type: ignore
466
467 self.oauth_token = (
468 github.Auth.Token(GithubCredentials.oauth_token) if GithubCredentials.oauth_token else None
469 )
470 self.jwt = github.Auth.AppAuthToken(GithubCredentials.jwt) if GithubCredentials.jwt else None
471 self.app_auth = (
472 github.Auth.AppAuth(GithubCredentials.app_id, GithubCredentials.app_private_key)
473 if GithubCredentials.app_id and GithubCredentials.app_private_key
474 else None
475 )
476 else:
477 ReplayingHttpConnection.setOpenFile(self.__openFile)
478 ReplayingHttpsConnection.setOpenFile(self.__openFile)
479 github.Requester.Requester.injectConnectionClasses(
480 ReplayingHttpConnection,
481 ReplayingHttpsConnection,
482 )
483 self.oauth_token = github.Auth.Token("oauth_token")
484 self.jwt = github.Auth.AppAuthToken("jwt")
485 self.app_auth = github.Auth.AppAuth(123456, APP_PRIVATE_KEY)
486
487 responses.start()
488
489 def setPerPage(self, per_page):
490 self.per_page = per_page

Callers

nothing calls this directly

Calls 3

setOpenFileMethod · 0.80
setUpMethod · 0.45

Tested by

no test coverage detected