From be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 04:57:58 +0200 Subject: Adding upstream version 1.44.3. Signed-off-by: Daniel Baumann --- .../deps/brotli/python/tests/compatibility_test.py | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 web/server/h2o/libh2o/deps/brotli/python/tests/compatibility_test.py (limited to 'web/server/h2o/libh2o/deps/brotli/python/tests/compatibility_test.py') diff --git a/web/server/h2o/libh2o/deps/brotli/python/tests/compatibility_test.py b/web/server/h2o/libh2o/deps/brotli/python/tests/compatibility_test.py new file mode 100755 index 00000000..668c9ece --- /dev/null +++ b/web/server/h2o/libh2o/deps/brotli/python/tests/compatibility_test.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +from __future__ import print_function +import glob +import sys +import os +from subprocess import check_call + +from test_utils import PYTHON, BRO, TEST_ENV, diff_q + + +os.chdir(os.path.abspath("../../tests")) +for filename in glob.glob("testdata/*.compressed*"): + filename = os.path.abspath(filename) + print('Testing decompression of file "%s"' % os.path.basename(filename)) + expected = filename.split(".compressed")[0] + uncompressed = expected + ".uncompressed" + check_call([PYTHON, BRO, "-f", "-d", "-i", filename, "-o", uncompressed], + env=TEST_ENV) + if diff_q(uncompressed, expected) != 0: + sys.exit(1) + # Test the streaming version + with open(filename, "rb") as infile, open(uncompressed, "wb") as outfile: + check_call([PYTHON, BRO, '-d'], stdin=infile, stdout=outfile, + env=TEST_ENV) + if diff_q(uncompressed, expected) != 0: + sys.exit(1) + os.unlink(uncompressed) -- cgit v1.2.3