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

Method test_init

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

Source from the content-addressed store, hash-verified

537class FileTestCase(unittest.TestCase):
538
539 def test_init(self):
540 with LZMAFile(BytesIO(COMPRESSED_XZ)) as f:
541 self.assertIsInstance(f, LZMAFile)
542 self.assertEqual(f.mode, "rb")
543 with LZMAFile(BytesIO(), "w") as f:
544 self.assertIsInstance(f, LZMAFile)
545 self.assertEqual(f.mode, "wb")
546 with LZMAFile(BytesIO(), "x") as f:
547 self.assertIsInstance(f, LZMAFile)
548 self.assertEqual(f.mode, "wb")
549 with LZMAFile(BytesIO(), "a") as f:
550 self.assertIsInstance(f, LZMAFile)
551 self.assertEqual(f.mode, "wb")
552
553 def test_init_with_PathLike_filename(self):
554 filename = FakePath(TESTFN)

Callers

nothing calls this directly

Calls 4

LZMAFileClass · 0.90
BytesIOClass · 0.90
assertIsInstanceMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected