MCPcopy Index your code
hub / github.com/python/cpython / test_read_missing_shebang

Method test_read_missing_shebang

Lib/test/test_zipapp.py:273–280  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

271 self.assertEqual(zipapp.get_interpreter(str(target)), 'python')
272
273 def test_read_missing_shebang(self):
274 # Test that reading the shebang line of a file without one returns None.
275 source = self.tmpdir / 'source'
276 source.mkdir()
277 (source / '__main__.py').touch()
278 target = self.tmpdir / 'source.pyz'
279 zipapp.create_archive(str(source), str(target))
280 self.assertEqual(zipapp.get_interpreter(str(target)), None)
281
282 def test_modify_shebang(self):
283 # Test that we can change the shebang of a file.

Callers

nothing calls this directly

Calls 5

strFunction · 0.85
get_interpreterMethod · 0.80
mkdirMethod · 0.45
touchMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected