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

Method testAddParametersToUrl

tests/Requester.py:165–186  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 1

add_parameters_to_urlMethod · 0.80

Tested by

no test coverage detected