MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_init

Method test_init

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

Source from the content-addressed store, hash-verified

542class FileTestCase(unittest.TestCase):
543
544 def test_init(self):
545 with LZMAFile(BytesIO(COMPRESSED_XZ)) as f:
546 self.assertIsInstance(f, LZMAFile)
547 self.assertEqual(f.mode, "rb")
548 with LZMAFile(BytesIO(), "w") as f:
549 self.assertIsInstance(f, LZMAFile)
550 self.assertEqual(f.mode, "wb")
551 with LZMAFile(BytesIO(), "x") as f:
552 self.assertIsInstance(f, LZMAFile)
553 self.assertEqual(f.mode, "wb")
554 with LZMAFile(BytesIO(), "a") as f:
555 self.assertIsInstance(f, LZMAFile)
556 self.assertEqual(f.mode, "wb")
557
558 @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: <FakePath '@test_23396_tmp챈'> != '@test_23396_tmp챈'
559 def test_init_with_PathLike_filename(self):

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