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

Method test_read_from_pathlike_obj

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

Source from the content-addressed store, hash-verified

303 self.assertStartsWith(new_target.getvalue(), b'#!python2.7\n')
304
305 def test_read_from_pathlike_obj(self):
306 # Test that we can copy an archive using a path-like object
307 # for the source.
308 source = self.tmpdir / 'source'
309 source.mkdir()
310 (source / '__main__.py').touch()
311 source = os_helper.FakePath(str(source))
312 target1 = os_helper.FakePath(str(self.tmpdir / 'target1.pyz'))
313 target2 = os_helper.FakePath(str(self.tmpdir / 'target2.pyz'))
314 zipapp.create_archive(source, target1, interpreter='python')
315 zipapp.create_archive(target1, target2, interpreter='python2.7')
316 self.assertEqual(zipapp.get_interpreter(target2), 'python2.7')
317
318 def test_read_from_fileobj(self):
319 # Test that we can copy an archive using an open file object.

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