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

Method test_remove_shebang

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

Source from the content-addressed store, hash-verified

329 self.assertStartsWith(new_target.getvalue(), b'#!python2.7\n')
330
331 def test_remove_shebang(self):
332 # Test that we can remove the shebang from a file.
333 source = self.tmpdir / 'source'
334 source.mkdir()
335 (source / '__main__.py').touch()
336 target = self.tmpdir / 'source.pyz'
337 zipapp.create_archive(str(source), str(target), interpreter='python')
338 new_target = self.tmpdir / 'changed.pyz'
339 zipapp.create_archive(str(target), str(new_target), interpreter=None)
340 self.assertEqual(zipapp.get_interpreter(str(new_target)), None)
341
342 def test_content_of_copied_archive(self):
343 # Test that copying an archive doesn't corrupt it.

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