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

Method create_hierarchy

Lib/test/test_pathlib/support/zip_path.py:51–63  ·  view source on GitHub ↗
(self, p)

Source from the content-addressed store, hash-verified

49 path.zip_file.writestr(zip_info, target.encode())
50
51 def create_hierarchy(self, p):
52 # Add regular files
53 self.create_file(p.joinpath('fileA'), b'this is file A\n')
54 self.create_file(p.joinpath('dirB/fileB'), b'this is file B\n')
55 self.create_file(p.joinpath('dirC/fileC'), b'this is file C\n')
56 self.create_file(p.joinpath('dirC/dirD/fileD'), b'this is file D\n')
57 self.create_file(p.joinpath('dirC/novel.txt'), b'this is a novel\n')
58 # Add symlinks
59 self.create_symlink(p.joinpath('linkA'), 'fileA')
60 self.create_symlink(p.joinpath('linkB'), 'dirB')
61 self.create_symlink(p.joinpath('dirA/linkC'), '../dirB')
62 self.create_symlink(p.joinpath('brokenLink'), 'non-existing')
63 self.create_symlink(p.joinpath('brokenLinkLoop'), 'brokenLinkLoop')
64
65 def readtext(self, p):
66 with p.zip_file.open(vfspath(p), 'r') as f:

Callers 2

setUpMethod · 0.45
setUpMethod · 0.45

Calls 3

create_fileMethod · 0.95
create_symlinkMethod · 0.95
joinpathMethod · 0.45

Tested by 2

setUpMethod · 0.36
setUpMethod · 0.36