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

Method test_list_paths

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

Source from the content-addressed store, hash-verified

356 raise
357
358 def test_list_paths(self):
359 data = self.run_py(["--list-paths"])
360 found = {}
361 expect = {}
362 for line in data["stdout"].splitlines():
363 m = re.match(r"\s*(.+?)\s+?(\*\s+)?(.+)$", line)
364 if m:
365 found[m.group(1)] = m.group(3)
366 for company in TEST_DATA:
367 company_data = TEST_DATA[company]
368 tags = [t for t in company_data if isinstance(company_data[t], dict)]
369 for tag in tags:
370 arg = f"-V:{company}/{tag}"
371 install = company_data[tag]["InstallPath"]
372 try:
373 expect[arg] = install["ExecutablePath"]
374 try:
375 expect[arg] += " " + install["ExecutableArguments"]
376 except KeyError:
377 pass
378 except KeyError:
379 expect[arg] = str(Path(install[None]) / Path(sys.executable).name)
380
381 expect.pop(f"-V:{company}/ignored", None)
382
383 actual = {k: v for k, v in found.items() if k in expect}
384 try:
385 self.assertDictEqual(expect, actual)
386 except:
387 if support.verbose:
388 print("*** STDOUT ***")
389 print(data["stdout"])
390 raise
391
392 def test_filter_to_company(self):
393 company = "PythonTestSuite"

Callers

nothing calls this directly

Calls 11

PathClass · 0.90
isinstanceFunction · 0.85
strFunction · 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