diff options
author | Benjamin Peterson <benjamin@python.org> | 2019-09-04 03:11:59 -0700 |
---|---|---|
committer | Chris Dent <cdent@anticdent.org> | 2019-09-04 11:11:59 +0100 |
commit | a55bf98f51c57880e9c2cead4c01b5c23ce09839 (patch) | |
tree | b7241aad669b616c37d8ff6275dcb60be9eb8596 /tests | |
parent | cdd2a9a58c59b8e599aa42b66b3c55ea47c7a4b7 (diff) | |
download | paste-git-a55bf98f51c57880e9c2cead4c01b5c23ce09839.tar.gz |
Make LimitedLengthFile file return empty bytes rather than empty string when it's done. (#32)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_httpserver.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_httpserver.py b/tests/test_httpserver.py index 3d72c79..20a4320 100644 --- a/tests/test_httpserver.py +++ b/tests/test_httpserver.py @@ -1,6 +1,7 @@ import email +import io -from paste.httpserver import WSGIHandler +from paste.httpserver import LimitedLengthFile, WSGIHandler from six.moves import StringIO @@ -43,3 +44,10 @@ def test_environ_with_multiple_values(): wsgi_handler.wsgi_setup() assert wsgi_handler.wsgi_environ['HTTP_HOST'] == 'host1,host2' + + +def test_limited_length_file(): + backing = io.BytesIO(b'0123456789') + f = LimitedLengthFile(backing, 9) + assert f.read() == b'012345678' + assert f.read() == b'' |