(self)
| 163 | ) |
| 164 | |
| 165 | def testAddParametersToUrl(self): |
| 166 | self.assertEqual("https://github.com/api", gr.Requester.add_parameters_to_url("https://github.com/api", {})) |
| 167 | self.assertEqual( |
| 168 | "https://github.com/api?per_page=10", |
| 169 | gr.Requester.add_parameters_to_url("https://github.com/api", {"per_page": 10}), |
| 170 | ) |
| 171 | self.assertEqual( |
| 172 | "https://github.com/api?page=2&per_page=10", |
| 173 | gr.Requester.add_parameters_to_url("https://github.com/api", {"per_page": 10, "page": 2}), |
| 174 | ) |
| 175 | self.assertEqual( |
| 176 | "https://github.com/api?page=2&per_page=10", |
| 177 | gr.Requester.add_parameters_to_url("https://github.com/api?per_page=10", {"page": 2}), |
| 178 | ) |
| 179 | self.assertEqual( |
| 180 | "https://github.com/api?page=2&per_page=10", |
| 181 | gr.Requester.add_parameters_to_url("https://github.com/api?per_page=10&page=1", {"page": 2}), |
| 182 | ) |
| 183 | self.assertEqual( |
| 184 | "https://github.com/api?item=3&item=4", |
| 185 | gr.Requester.add_parameters_to_url("https://github.com/api?item=1&item=2&item=3", {"item": [3, 4]}), |
| 186 | ) |
| 187 | |
| 188 | def testCloseGithub(self): |
| 189 | mocked_connection = mock.MagicMock() |
nothing calls this directly
no test coverage detected