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

Method test_init_with_PathLike_filename

Lib/test/test_lzma.py:553–564  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

551 self.assertEqual(f.mode, "wb")
552
553 def test_init_with_PathLike_filename(self):
554 filename = FakePath(TESTFN)
555 with TempFile(filename, COMPRESSED_XZ):
556 with LZMAFile(filename) as f:
557 self.assertEqual(f.read(), INPUT)
558 self.assertEqual(f.name, TESTFN)
559 with LZMAFile(filename, "a") as f:
560 f.write(INPUT)
561 self.assertEqual(f.name, TESTFN)
562 with LZMAFile(filename) as f:
563 self.assertEqual(f.read(), INPUT * 2)
564 self.assertEqual(f.name, TESTFN)
565
566 def test_init_with_filename(self):
567 with TempFile(TESTFN, COMPRESSED_XZ):

Callers

nothing calls this directly

Calls 6

FakePathClass · 0.90
LZMAFileClass · 0.90
TempFileClass · 0.70
assertEqualMethod · 0.45
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected