MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_list

Method test_list

Lib/test/test_launcher.py:333–356  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

331 self.assertEqual(v2, data["SearchInfo.listPaths"])
332
333 def test_list(self):
334 data = self.run_py(["--list"])
335 found = {}
336 expect = {}
337 for line in data["stdout"].splitlines():
338 m = re.match(r"\s*(.+?)\s+?(\*\s+)?(.+)$", line)
339 if m:
340 found[m.group(1)] = m.group(3)
341 for company in TEST_DATA:
342 company_data = TEST_DATA[company]
343 tags = [t for t in company_data if isinstance(company_data[t], dict)]
344 for tag in tags:
345 arg = f"-V:{company}/{tag}"
346 expect[arg] = company_data[tag]["DisplayName"]
347 expect.pop(f"-V:{company}/ignored", None)
348
349 actual = {k: v for k, v in found.items() if k in expect}
350 try:
351 self.assertDictEqual(expect, actual)
352 except:
353 if support.verbose:
354 print("*** STDOUT ***")
355 print(data["stdout"])
356 raise
357
358 def test_list_paths(self):
359 data = self.run_py(["--list-paths"])

Callers

nothing calls this directly

Calls 9

isinstanceFunction · 0.85
run_pyMethod · 0.80
assertDictEqualMethod · 0.80
printFunction · 0.50
splitlinesMethod · 0.45
matchMethod · 0.45
groupMethod · 0.45
popMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected