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

Method test_filename

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

Source from the content-addressed store, hash-verified

1414 self.assertEqual(file_data, uncompressed_raw * 2)
1415
1416 def test_filename(self):
1417 with TempFile(TESTFN):
1418 with lzma.open(TESTFN, "wb") as f:
1419 f.write(INPUT)
1420 with open(TESTFN, "rb") as f:
1421 file_data = lzma.decompress(f.read())
1422 self.assertEqual(file_data, INPUT)
1423 with lzma.open(TESTFN, "rb") as f:
1424 self.assertEqual(f.read(), INPUT)
1425 with lzma.open(TESTFN, "ab") as f:
1426 f.write(INPUT)
1427 with lzma.open(TESTFN, "rb") as f:
1428 self.assertEqual(f.read(), INPUT * 2)
1429
1430 def test_with_pathlike_filename(self):
1431 filename = FakePath(TESTFN)

Callers

nothing calls this directly

Calls 7

decompressMethod · 0.80
TempFileClass · 0.70
openFunction · 0.50
openMethod · 0.45
writeMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected