def test_compressed_effectively_no_orig_size(): compressor = Compressor(quiet=True) assert not compressor.is_compressed_effectively( "test_encoding", "test_path", 0, "test_data" )
def test_compress(): compressor = Compressor(use_brotli=False, use_gzip=False) assert [] == list(compressor.compress("tests/test_files/static/styles.css"))
def test_with_falsey_extensions(): compressor = Compressor(quiet=True) assert compressor.get_extension_re("") == re.compile("^$")
def test_custom_log(): compressor = Compressor(log="test") assert compressor.log == "test"
def test_with_custom_extensions(): compressor = Compressor(extensions=["jpg"], quiet=True) assert compressor.extension_re == re.compile(r"\.(jpg)$", re.IGNORECASE)