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

Method test_option

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

Source from the content-addressed store, hash-verified

2563 os.remove(TESTFN)
2564
2565 def test_option(self):
2566 options = {DecompressionParameter.window_log_max:25}
2567 with open(io.BytesIO(COMPRESSED_100_PLUS_32KB), "rb", options=options) as f:
2568 self.assertEqual(f.read(), DECOMPRESSED_100_PLUS_32KB)
2569
2570 options = {CompressionParameter.compression_level:12}
2571 with io.BytesIO() as bio:
2572 with open(bio, "wb", options=options) as f:
2573 f.write(DECOMPRESSED_100_PLUS_32KB)
2574 file_data = decompress(bio.getvalue())
2575 self.assertEqual(file_data, DECOMPRESSED_100_PLUS_32KB)
2576
2577 def test_encoding(self):
2578 uncompressed = THIS_FILE_STR.replace(os.linesep, "\n")

Callers

nothing calls this directly

Calls 6

openFunction · 0.90
decompressFunction · 0.90
assertEqualMethod · 0.45
readMethod · 0.45
writeMethod · 0.45
getvalueMethod · 0.45

Tested by

no test coverage detected