(self)
| 93 | self.assertListEqual([repo.full_name for repo in repos], ["EnricoMi/sandbox", "EnricoMi/python"]) |
| 94 | |
| 95 | def testGetGithubForInstallation(self): |
| 96 | # with verify=False, urllib3.connectionpool rightly may issue an InsecureRequestWarning |
| 97 | # we ignore InsecureRequestWarning from urllib3.connectionpool |
| 98 | with self.ignoreWarning(category=InsecureRequestWarning, module="urllib3.connectionpool"): |
| 99 | kwargs = dict( |
| 100 | auth=AppAuth(319953, GithubIntegration.PRIVATE_KEY), |
| 101 | # http protocol used to deviate from default base url, recording data might require https |
| 102 | base_url="http://api.github.com", |
| 103 | timeout=Consts.DEFAULT_TIMEOUT + 10, |
| 104 | user_agent="PyGithub/Python-Test", |
| 105 | per_page=Consts.DEFAULT_PER_PAGE + 10, |
| 106 | verify=False, |
| 107 | retry=3, |
| 108 | pool_size=10, |
| 109 | seconds_between_requests=100, |
| 110 | seconds_between_writes=1000, |
| 111 | # v3: this should not be the default value, so if this has been changed in v3, |
| 112 | # change it here is well |
| 113 | lazy=True, |
| 114 | ) |
| 115 | |
| 116 | # assert kwargs consists of ALL requester constructor arguments |
| 117 | self.assertEqual(kwargs.keys(), github.Requester.Requester.__init__.__annotations__.keys()) |
| 118 | |
| 119 | integration = github.GithubIntegration(**kwargs) |
| 120 | installations = list(integration.get_installations()) |
| 121 | installation = installations[0] |
| 122 | |
| 123 | g = installation.get_github_for_installation() |
| 124 | |
| 125 | self.assertIsInstance(g._Github__requester.auth, AppInstallationAuth) |
| 126 | |
| 127 | actual = g._Github__requester.kwargs |
| 128 | kwargs.update(auth=str(AppInstallationAuth)) |
| 129 | actual.update(auth=str(type(actual["auth"]))) |
| 130 | self.assertDictEqual(kwargs, actual) |
| 131 | |
| 132 | repo = g.get_repo("PyGithub/PyGithub") |
| 133 | self.assertEqual(repo.id, 3544490) |
| 134 | self.assertEqual(repo.full_name, "PyGithub/PyGithub") |
| 135 | |
| 136 | def testRequester(self): |
| 137 | self.assertEqual(len(self.installations), 1) |
nothing calls this directly
no test coverage detected