Files
brotli/python/tests/compress_test.py
Evgenii Kliuchnikov f81d6bc7f0 Modernize tests.
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
2025-11-19 02:56:01 -08:00

20 lines
648 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("quality", [1, 6, 9, 11])
@pytest.mark.parametrize("lgwin", [10, 15, 20, 24])
@pytest.mark.parametrize("text_name", _test_utils.gather_text_inputs())
def test_compress(quality, lgwin, text_name):
original = _test_utils.take_input(text_name)
compressed = brotli.compress(original, quality=quality, lgwin=lgwin)
decompressed = brotli.decompress(compressed)
assert original == decompressed