[PR #38] [MERGED] add Python port of bro utility and scripts to test Brotli extension #619

Open
opened 2026-01-29 20:46:27 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/google/brotli/pull/38
Author: @anthrotype
Created: 3/16/2015
Status: Merged
Merged: 3/16/2015
Merged by: @szabadka

Base: masterHead: py_tests


📝 Commits (1)

  • b33e10e add Python port of bro utility and scripts to test Brotli extension

📊 Changes

3 files changed (+234 additions, -0 deletions)

View changed files

python/bro.py (+131 -0)
python/tests/compatibility_test.py (+55 -0)
python/tests/roundtrip_test.py (+48 -0)

📄 Description

The bro.py accepts the same options as the bro command-line utility, and supports piping to/from the standard streams.
The test scripts are simple Python ports of compatibility_test.sh and roundtrip_test.sh shell script.

I made that to be able to test the Brotli Python extension against the same data used by the test shell scripts.
The scripts are especially useful on Windows, which doesn't include the bash shell, and where the bro utility fails to compile using the native MSVC compiler.

Please note that bro.py depends on @khaledhosny's #36 patch, since it just calls brotli.decompress(string) and expects the decompression buffer to be dynamically allocated.

Thank you.

Cosimo


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/google/brotli/pull/38 **Author:** [@anthrotype](https://github.com/anthrotype) **Created:** 3/16/2015 **Status:** ✅ Merged **Merged:** 3/16/2015 **Merged by:** [@szabadka](https://github.com/szabadka) **Base:** `master` ← **Head:** `py_tests` --- ### 📝 Commits (1) - [`b33e10e`](https://github.com/google/brotli/commit/b33e10e9dc078e2efd761db82041800bcfbf4d8f) add Python port of bro utility and scripts to test Brotli extension ### 📊 Changes **3 files changed** (+234 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `python/bro.py` (+131 -0) ➕ `python/tests/compatibility_test.py` (+55 -0) ➕ `python/tests/roundtrip_test.py` (+48 -0) </details> ### 📄 Description The `bro.py` accepts the same options as the `bro` command-line utility, and supports piping to/from the standard streams. The test scripts are simple Python ports of `compatibility_test.sh` and `roundtrip_test.sh` shell script. I made that to be able to test the Brotli Python extension against the same data used by the test shell scripts. The scripts are especially useful on Windows, which doesn't include the bash shell, and where the `bro` utility fails to compile using the native MSVC compiler. Please note that `bro.py` depends on @khaledhosny's #36 patch, since it just calls `brotli.decompress(string)` and expects the decompression buffer to be dynamically allocated. Thank you. Cosimo --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 20:46:27 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#619