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

Method test_init_with_PathLike_filename

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

Source from the content-addressed store, hash-verified

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