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

Method test_write_python_package

Lib/test/test_zipfile/test_core.py:1485–1497  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1483 self.assertCompiledIn(bn, zipfp.namelist())
1484
1485 def test_write_python_package(self):
1486 import email
1487 packagedir = os.path.dirname(email.__file__)
1488 self.requiresWriteAccess(packagedir)
1489
1490 with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
1491 zipfp.writepy(packagedir)
1492
1493 # Check for a couple of modules at different levels of the
1494 # hierarchy
1495 names = zipfp.namelist()
1496 self.assertCompiledIn('email/__init__.py', names)
1497 self.assertCompiledIn('email/mime/text.py', names)
1498
1499 def test_write_filtered_python_package(self):
1500 import test

Callers

nothing calls this directly

Calls 6

requiresWriteAccessMethod · 0.95
assertCompiledInMethod · 0.95
TemporaryFileFunction · 0.90
writepyMethod · 0.80
dirnameMethod · 0.45
namelistMethod · 0.45

Tested by

no test coverage detected