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

Method test_basic_with_bytes_names

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

Source from the content-addressed store, hash-verified

425 self.do_create(pre="aa", suf=".txt").write(b"blat")
426
427 def test_basic_with_bytes_names(self):
428 # _mkstemp_inner can create files when given name parts all
429 # specified as bytes.
430 dir_b = tempfile.gettempdirb()
431 self.do_create(dir=dir_b, suf=b"").write(b"blat")
432 self.do_create(dir=dir_b, pre=b"a").write(b"blat")
433 self.do_create(dir=dir_b, suf=b"b").write(b"blat")
434 self.do_create(dir=dir_b, pre=b"a", suf=b"b").write(b"blat")
435 self.do_create(dir=dir_b, pre=b"aa", suf=b".txt").write(b"blat")
436 # Can't mix str & binary types in the args.
437 with self.assertRaises(TypeError):
438 self.do_create(dir="", suf=b"").write(b"blat")
439 with self.assertRaises(TypeError):
440 self.do_create(dir=dir_b, pre="").write(b"blat")
441 with self.assertRaises(TypeError):
442 self.do_create(dir=dir_b, pre=b"", suf="").write(b"blat")
443
444 def test_basic_many(self):
445 # _mkstemp_inner can create many files (stochastic)

Callers

nothing calls this directly

Calls 3

do_createMethod · 0.95
writeMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected