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

Method test_init_with_PathLike_filename

Lib/test/test_zstd.py:1580–1594  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1578 pass
1579
1580 def test_init_with_PathLike_filename(self):
1581 with tempfile.NamedTemporaryFile(delete=False) as tmp_f:
1582 filename = pathlib.Path(tmp_f.name)
1583
1584 with ZstdFile(filename, "a") as f:
1585 f.write(DECOMPRESSED_100_PLUS_32KB)
1586 with ZstdFile(filename) as f:
1587 self.assertEqual(f.read(), DECOMPRESSED_100_PLUS_32KB)
1588
1589 with ZstdFile(filename, "a") as f:
1590 f.write(DECOMPRESSED_100_PLUS_32KB)
1591 with ZstdFile(filename) as f:
1592 self.assertEqual(f.read(), DECOMPRESSED_100_PLUS_32KB * 2)
1593
1594 os.remove(filename)
1595
1596 def test_init_with_filename(self):
1597 with tempfile.NamedTemporaryFile(delete=False) as tmp_f:

Callers

nothing calls this directly

Calls 5

ZstdFileClass · 0.90
writeMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected