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

Method test_init_with_filename

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

Source from the content-addressed store, hash-verified

564 self.assertEqual(f.name, TESTFN)
565
566 def test_init_with_filename(self):
567 with TempFile(TESTFN, COMPRESSED_XZ):
568 with LZMAFile(TESTFN) as f:
569 self.assertEqual(f.name, TESTFN)
570 self.assertEqual(f.mode, 'rb')
571 with LZMAFile(TESTFN, "w") as f:
572 self.assertEqual(f.name, TESTFN)
573 self.assertEqual(f.mode, 'wb')
574 with LZMAFile(TESTFN, "a") as f:
575 self.assertEqual(f.name, TESTFN)
576 self.assertEqual(f.mode, 'wb')
577
578 def test_init_mode(self):
579 with TempFile(TESTFN):

Callers

nothing calls this directly

Calls 3

LZMAFileClass · 0.90
TempFileClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected