aboutsummaryrefslogtreecommitdiff
path: root/python/tests/custom_dictionary_test.py
diff options
context:
space:
mode:
authorAlex Nicksay <nicksay@gmail.com>2016-12-09 07:44:05 -0500
committerEugene Kliuchnikov <eustas@google.com>2016-12-09 13:44:05 +0100
commit4a60128c1339f74c13f0c8ae27a5dfe426b14208 (patch)
tree19d3b8e1b6035e5535411673782670b4453447a6 /python/tests/custom_dictionary_test.py
parent50bc3a7145e6bc35bec72ae9755bb6119b8accfb (diff)
downloadbrotli-4a60128c1339f74c13f0c8ae27a5dfe426b14208.zip
brotli-4a60128c1339f74c13f0c8ae27a5dfe426b14208.tar.gz
brotli-4a60128c1339f74c13f0c8ae27a5dfe426b14208.tar.bz2
Python: Convert bro.py tests to unittest style (#478)
* Create unittest-style tests for `bro.py` decompression and compression * Delete old tests for `bro.py` * Update test method generation to properly create a Cartesian product of iterables using `itertools.product`
Diffstat (limited to 'python/tests/custom_dictionary_test.py')
-rw-r--r--python/tests/custom_dictionary_test.py41
1 files changed, 0 insertions, 41 deletions
diff --git a/python/tests/custom_dictionary_test.py b/python/tests/custom_dictionary_test.py
deleted file mode 100644
index 07aa3c1..0000000
--- a/python/tests/custom_dictionary_test.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env python
-from __future__ import print_function
-import sys
-import os
-from subprocess import check_call, Popen, PIPE
-
-from _test_utils import PYTHON, BRO, TEST_ENV, diff_q
-
-
-INPUTS = """\
-testdata/alice29.txt
-testdata/asyoulik.txt
-testdata/lcet10.txt
-testdata/plrabn12.txt
-../enc/encode.c
-../common/dictionary.h
-../dec/decode.c
-%s
-""" % BRO
-
-os.chdir(os.path.abspath("../../tests"))
-for filename in INPUTS.splitlines():
- for quality in (1, 6, 9, 11):
- for lgwin in (10, 15, 20, 24):
- filename = os.path.abspath(filename)
- print('Roundtrip testing file "%s" at quality %d with lg(win)=%d and auto-custom-dictionary' %
- (os.path.basename(filename), quality, lgwin))
- compressed = os.path.splitext(filename)[0] + ".custom_bro"
- uncompressed = os.path.splitext(filename)[0] + ".custom_unbro"
- check_call([PYTHON, BRO, "-f", "-q", str(quality), "-i", filename,
- "-o", compressed, "--lgwin", str(lgwin),
- "--custom-dictionary", filename], env=TEST_ENV)
- check_call([PYTHON, BRO, "-f", "-d", "-i", compressed, "-o",
- uncompressed, "--custom-dictionary", filename], env=TEST_ENV)
- if diff_q(filename, uncompressed) != 0:
- sys.exit(1)
- try:
- os.unlink(compressed)
- os.unlink(uncompressed)
- except OSError:
- pass