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

Method test_with_pathlike_filename

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

Source from the content-addressed store, hash-verified

1428 self.assertEqual(f.read(), INPUT * 2)
1429
1430 def test_with_pathlike_filename(self):
1431 filename = FakePath(TESTFN)
1432 with TempFile(filename):
1433 with lzma.open(filename, "wb") as f:
1434 f.write(INPUT)
1435 self.assertEqual(f.name, TESTFN)
1436 with open(filename, "rb") as f:
1437 file_data = lzma.decompress(f.read())
1438 self.assertEqual(file_data, INPUT)
1439 with lzma.open(filename, "rb") as f:
1440 self.assertEqual(f.read(), INPUT)
1441 self.assertEqual(f.name, TESTFN)
1442
1443 def test_bad_params(self):
1444 # Test invalid parameter combinations.

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected