MCPcopy Index your code
hub / github.com/RustPython/RustPython / do_create2

Method do_create2

Lib/test/test_tempfile.py:1629–1638  ·  view source on GitHub ↗
(self, path, recurse=1, dirs=1, files=1)

Source from the content-addressed store, hash-verified

1627 return tmp
1628
1629 def do_create2(self, path, recurse=1, dirs=1, files=1):
1630 # Create subdirectories and some files
1631 if recurse:
1632 for i in range(dirs):
1633 name = os.path.join(path, "dir%d" % i)
1634 os.mkdir(name)
1635 self.do_create2(name, recurse-1, dirs, files)
1636 for i in range(files):
1637 with open(os.path.join(path, "test%d.txt" % i), "wb") as f:
1638 f.write(b"Hello world!")
1639
1640 def test_mkdtemp_failure(self):
1641 # Check no additional exception if mkdtemp fails

Callers 1

do_createMethod · 0.95

Calls 4

openFunction · 0.50
joinMethod · 0.45
mkdirMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected