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

Method test_textmode

Lib/test/test_tempfile.py:514–522  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

512
513 @unittest.skipUnless(has_textmode, "text mode not available")
514 def test_textmode(self):
515 # _mkstemp_inner can create files in text mode
516
517 # A text file is truncated at the first Ctrl+Z byte
518 f = self.do_create(bin=0)
519 f.write(b"blat\x1a")
520 f.write(b"extra\n")
521 os.lseek(f.fd, 0, os.SEEK_SET)
522 self.assertEqual(os.read(f.fd, 20), b"blat")
523
524 def make_temp(self):
525 return tempfile._mkstemp_inner(tempfile.gettempdir(),

Callers

nothing calls this directly

Calls 4

do_createMethod · 0.95
writeMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected