aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorBrotli <no-reply@google.com>2023-01-16 18:04:35 +0000
committerEvgenii Kliuchnikov <eustas.ru@gmail.com>2023-01-17 13:51:00 +0000
commit36533a866ed1ca4b75cf049f4521e4ec5fe24727 (patch)
tree8ee92b5b4ad5e16c0661e9dcf25ba49012c1dc7a /python
parent71fe6cac061ac62c0241f410fbd43a04a6b4f303 (diff)
downloadbrotli-36533a866ed1ca4b75cf049f4521e4ec5fe24727.zip
brotli-36533a866ed1ca4b75cf049f4521e4ec5fe24727.tar.gz
brotli-36533a866ed1ca4b75cf049f4521e4ec5fe24727.tar.bz2
Internal change
PiperOrigin-RevId: 502401179
Diffstat (limited to 'python')
-rw-r--r--python/README.md2
-rwxr-xr-x[-rw-r--r--]python/bro.py2
-rw-r--r--python/brotli.py2
-rw-r--r--python/tests/_test_utils.py10
-rw-r--r--python/tests/bro_test.py1
5 files changed, 12 insertions, 5 deletions
diff --git a/python/README.md b/python/README.md
index 6a9068a..4b6f63f 100644
--- a/python/README.md
+++ b/python/README.md
@@ -22,7 +22,7 @@ following command from this directory:
You may run the following commands from this directory:
$ make # Build the module in-place
-
+
$ make test # Test the module
$ make clean # Remove all temporary files and build output
diff --git a/python/bro.py b/python/bro.py
index 7a094b4..6d71549 100644..100755
--- a/python/bro.py
+++ b/python/bro.py
@@ -51,7 +51,7 @@ def main(args=None):
parser = argparse.ArgumentParser(
prog=os.path.basename(__file__), description=__doc__)
parser.add_argument(
- '--version', action='version', version=brotli.__version__)
+ '--version', action='version', version=brotli.version)
parser.add_argument(
'-i',
'--input',
diff --git a/python/brotli.py b/python/brotli.py
index 9f8bc24..9be4ed4 100644
--- a/python/brotli.py
+++ b/python/brotli.py
@@ -8,7 +8,7 @@
import _brotli
# The library version.
-__version__ = _brotli.__version__
+version = __version__ = _brotli.__version__
# The compression mode.
MODE_GENERIC = _brotli.MODE_GENERIC
diff --git a/python/tests/_test_utils.py b/python/tests/_test_utils.py
index 03868e9..059cb43 100644
--- a/python/tests/_test_utils.py
+++ b/python/tests/_test_utils.py
@@ -44,9 +44,17 @@ TESTDATA_FILES = [
'alice29.txt', # Large text
'random_org_10k.bin', # Small data
'mapsdatazrh', # Large data
+ 'ukkonooa', # Poem
]
-TESTDATA_PATHS = [os.path.join(TESTDATA_DIR, f) for f in TESTDATA_FILES]
+# Some files might be missing in a lightweight sources pack.
+TESTDATA_PATH_CANDIDATES = [
+ os.path.join(TESTDATA_DIR, f) for f in TESTDATA_FILES
+]
+
+TESTDATA_PATHS = [
+ path for path in TESTDATA_PATH_CANDIDATES if os.path.isfile(path)
+]
TESTDATA_PATHS_FOR_DECOMPRESSION = glob.glob(
os.path.join(TESTDATA_DIR, '*.compressed'))
diff --git a/python/tests/bro_test.py b/python/tests/bro_test.py
index b55129d..454bd62 100644
--- a/python/tests/bro_test.py
+++ b/python/tests/bro_test.py
@@ -7,7 +7,6 @@ import subprocess
import unittest
from . import _test_utils
-import brotli
BRO_ARGS = _test_utils.BRO_ARGS
TEST_ENV = _test_utils.TEST_ENV