diff options
Diffstat (limited to 'lulua/test_text.py')
-rw-r--r-- | lulua/test_text.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lulua/test_text.py b/lulua/test_text.py index 65aa3a1..cd8ae7a 100644 --- a/lulua/test_text.py +++ b/lulua/test_text.py @@ -18,7 +18,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -from .text import charMap, mapChars +import brotli +from io import BytesIO + +from .text import charMap, mapChars, BrotliFile def test_map_chars_mapped (): """ Make sure all chars in the map are mapped correctly """ @@ -46,3 +49,12 @@ def test_map_chars_not_mapped (): outText = mapChars (inText, charMap) assert outText == expectText +def test_brotlifile (): + compressed = brotli.compress (b'hello world') + for chunk in (1, 2, 3, 1024, None): + f = BrotliFile (BytesIO (compressed), chunk) + s = f.read (1) + assert s == b'h' + s = f.read () + assert s == b'ello world' + |