MCPcopy Index your code
hub / github.com/google/brotli / _check_decompression

Method _check_decompression

python/tests/compressor_test.py:25–33  ·  view source on GitHub ↗
(self, test_data)

Source from the content-addressed store, hash-verified

23 # super().tearDown() # Requires Py3+
24
25 def _check_decompression(self, test_data):
26 # Write decompression to temp file and verify it matches the original.
27 temp_uncompressed = _test_utils.get_temp_uncompressed_name(test_data)
28 temp_compressed = _test_utils.get_temp_compressed_name(test_data)
29 original = test_data
30 with open(temp_uncompressed, 'wb') as out_file:
31 with open(temp_compressed, 'rb') as in_file:
32 out_file.write(brotli.decompress(in_file.read()))
33 self.assert_files_match(temp_uncompressed, original)
34
35 def _test_single_process(self, test_data):
36 # Write single-shot compression to temp file.

Callers 3

_test_single_processMethod · 0.95

Calls 4

assert_files_matchMethod · 0.80
writeMethod · 0.45
decompressMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected