mirror of
https://github.com/google/brotli.git
synced 2026-02-08 13:49:23 +00:00
Avoid file IO. Drive-by: drop bro.py and bro_test.py; we do not support it well and likely no one uses it. PiperOrigin-RevId: 834206605
25 lines
692 B
Python
25 lines
692 B
Python
# Copyright 2016 The Brotli Authors. All rights reserved.
|
|
#
|
|
# Distributed under MIT license.
|
|
# See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
|
|
|
|
import brotli
|
|
import pytest
|
|
|
|
from . import _test_utils
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
'compressed_name, original_name', _test_utils.gather_compressed_inputs()
|
|
)
|
|
def test_decompress(compressed_name, original_name):
|
|
compressed = _test_utils.take_input(compressed_name)
|
|
original = _test_utils.take_input(original_name)
|
|
decompressed = brotli.decompress(compressed)
|
|
assert decompressed == original
|
|
|
|
|
|
def test_garbage_appended():
|
|
with pytest.raises(brotli.error):
|
|
brotli.decompress(brotli.compress(b'a') + b'a')
|