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

Method testSearchHighlightingCode

tests/Search.py:264–291  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

262 self.assertEqual(content[:30], "https\nGET\napi.github.com\nNone\n")
263
264 def testSearchHighlightingCode(self):
265 files = self.g.search_code("toto", sort="indexed", order="asc", user="jacquev6", highlight=True)
266 self.assertEqual(files[0].score, 14.030813)
267 self.assertEqual(
268 files[0].text_matches,
269 [
270 {
271 "fragment": ".assertEqual(\n"
272 " self.recorded.instance_method(42, 43, 44, 45, "
273 "toto=46, tutu=47",
274 "matches": [{"indices": [72, 76], "text": "toto"}],
275 "object_type": "FileContent",
276 "object_url": "https://api.github.com/repositories/6430524/contents/MockMockMock/tests/record_replay.py?ref=562a55542f55426f6853f3013309c85f402c359e",
277 "property": "content",
278 },
279 {
280 "fragment": "),\n"
281 " \"(42, 43, (44, 45), [('toto', 46), ('tutu', "
282 '47)])"\n'
283 " )\n"
284 " self.assertEqual",
285 "matches": [{"indices": [38, 42], "text": "toto"}],
286 "object_type": "FileContent",
287 "object_url": "https://api.github.com/repositories/6430524/contents/MockMockMock/tests/record_replay.py?ref=562a55542f55426f6853f3013309c85f402c359e",
288 "property": "content",
289 },
290 ],
291 )
292
293 def testUrlquotingOfQualifiers(self):
294 # Example taken from #236

Callers

nothing calls this directly

Calls 1

search_codeMethod · 0.80

Tested by

no test coverage detected