diff options
author | Andrey Zelenkov <zelenkov@nginx.com> | 2018-07-30 16:40:52 +0300 |
---|---|---|
committer | Andrey Zelenkov <zelenkov@nginx.com> | 2018-07-30 16:40:52 +0300 |
commit | a458f50d59ddddfd9de331f45c712fc3600295ec (patch) | |
tree | 04dbdfb3c9eda2019ed6bccde5c9b6f08b39c707 /test/unit.py | |
parent | 4b67de4bbb7f7cc6e1337ab9b7479695fd068b74 (diff) | |
download | unit-a458f50d59ddddfd9de331f45c712fc3600295ec.tar.gz unit-a458f50d59ddddfd9de331f45c712fc3600295ec.tar.bz2 |
Tests: fixed header value char tests.
Use byte strings to avoid problems with encoding.
Diffstat (limited to 'test/unit.py')
-rw-r--r-- | test/unit.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/unit.py b/test/unit.py index c8820280..dfd8f4fc 100644 --- a/test/unit.py +++ b/test/unit.py @@ -250,7 +250,8 @@ class TestUnitHTTP(TestUnit): if '--verbose' in sys.argv: print('>>>', req, sep='\n') - resp = self.recvall(sock) + encoding = 'utf-8' if 'encoding' not in kwargs else kwargs['encoding'] + resp = self.recvall(sock).decode(encoding) if '--verbose' in sys.argv: print('<<<', resp.encode('utf-8'), sep='\n') @@ -289,7 +290,7 @@ class TestUnitHTTP(TestUnit): if not len(part): break - return data.decode() + return data def _resp_to_dict(self, resp): m = re.search('(.*?\x0d\x0a?)\x0d\x0a?(.*)', resp, re.M | re.S) |