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

Method do_create

Lib/test/test_tempfile.py:384–398  ·  view source on GitHub ↗
(self, dir=None, pre=None, suf=None, bin=1)

Source from the content-addressed store, hash-verified

382 self._unlink(self.name)
383
384 def do_create(self, dir=None, pre=None, suf=None, bin=1):
385 output_type = tempfile._infer_return_type(dir, pre, suf)
386 if dir is None:
387 if output_type is str:
388 dir = tempfile.gettempdir()
389 else:
390 dir = tempfile.gettempdirb()
391 if pre is None:
392 pre = output_type()
393 if suf is None:
394 suf = output_type()
395 file = self.mkstemped(dir, pre, suf, bin)
396
397 self.nameCheck(file.name, dir, pre, suf)
398 return file
399
400 def test_basic(self):
401 # _mkstemp_inner can create files

Callers 7

test_basicMethod · 0.95
test_basic_manyMethod · 0.95
test_choose_directoryMethod · 0.95
test_file_modeMethod · 0.95
test_noinheritMethod · 0.95
test_textmodeMethod · 0.95

Calls 1

nameCheckMethod · 0.80

Tested by

no test coverage detected