diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:18 +0000 |
commit | 5da14042f70711ea5cf66e034699730335462f66 (patch) | |
tree | 0f6354ccac934ed87a2d555f45be4c831cf92f4a /src/web/server/h2o/libh2o/deps/brotli/python/tests/compatibility_test.py | |
parent | Releasing debian version 1.44.3-2. (diff) | |
download | netdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz netdata-5da14042f70711ea5cf66e034699730335462f66.zip |
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/web/server/h2o/libh2o/deps/brotli/python/tests/compatibility_test.py')
-rwxr-xr-x | src/web/server/h2o/libh2o/deps/brotli/python/tests/compatibility_test.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/web/server/h2o/libh2o/deps/brotli/python/tests/compatibility_test.py b/src/web/server/h2o/libh2o/deps/brotli/python/tests/compatibility_test.py new file mode 100755 index 000000000..668c9ecee --- /dev/null +++ b/src/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) |