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

Method make_zip_path

Lib/test/test_zipfile/_path/test_complexity.py:30–39  ·  view source on GitHub ↗

Construct a Path with width files at every level of depth.

(self, depth=1, width=1)

Source from the content-addressed store, hash-verified

28 assert best <= big_o.complexities.Linear
29
30 def make_zip_path(self, depth=1, width=1) -> zipfile.Path:
31 """
32 Construct a Path with width files at every level of depth.
33 """
34 zf = zipfile.ZipFile(io.BytesIO(), mode='w')
35 pairs = itertools.product(self.make_deep_paths(depth), self.make_names(width))
36 for path, name in pairs:
37 zf.writestr(f"{path}{name}.txt", b'')
38 zf.filename = "big un.zip"
39 return zipfile.Path(zf)
40
41 @classmethod
42 def make_names(cls, width, letters=string.ascii_lowercase):

Callers 2

test_glob_widthMethod · 0.95

Calls 3

make_deep_pathsMethod · 0.95
make_namesMethod · 0.95
writestrMethod · 0.95

Tested by

no test coverage detected