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

Method test_py_shebang_invalid_bom

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

Source from the content-addressed store, hash-verified

637 self.assertEqual(f"X.Y.exe -prearg {quote(script)} -postarg", data["stdout"].strip())
638
639 def test_py_shebang_invalid_bom(self):
640 with self.py_ini(TEST_PY_DEFAULTS):
641 content = "#! /usr/bin/python3 -prearg".encode("utf-8")
642 with self.script(b"\xEF\xAA\xBF" + content) as script:
643 data = self.run_py([script, "-postarg"])
644 self.assertIn("Invalid BOM", data["stderr"])
645 self.assertEqual("PythonTestSuite", data["SearchInfo.company"])
646 self.assertEqual("3.100", data["SearchInfo.tag"])
647 self.assertEqual(f"X.Y.exe {quote(script)} -postarg", data["stdout"].strip())
648
649 def test_py_handle_64_in_ini(self):
650 with self.py_ini("\n".join(["[defaults]", "python=3.999-64"])):

Callers

nothing calls this directly

Calls 8

py_iniMethod · 0.80
scriptMethod · 0.80
run_pyMethod · 0.80
assertInMethod · 0.80
quoteFunction · 0.70
encodeMethod · 0.45
assertEqualMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected