summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2018-09-04 02:30:27 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2018-09-04 02:30:27 +0300
commit9f5349d347bf6970366414d6328e57a89107c8d7 (patch)
treecad5772eb14d97b7f6e7c1d79c400278ed5914ae
parent6bebbe3e8a0732628514f356a7db470a110a76e6 (diff)
downloadunit-9f5349d347bf6970366414d6328e57a89107c8d7.tar.gz
unit-9f5349d347bf6970366414d6328e57a89107c8d7.tar.bz2
Tests: "no_recv" option introduced.
-rw-r--r--test/unit.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/unit.py b/test/unit.py
index 35c00f97..973a69b7 100644
--- a/test/unit.py
+++ b/test/unit.py
@@ -250,8 +250,11 @@ class TestUnitHTTP(TestUnit):
if '--verbose' in sys.argv:
print('>>>', req, sep='\n')
- encoding = 'utf-8' if 'encoding' not in kwargs else kwargs['encoding']
- resp = self.recvall(sock).decode(encoding)
+ resp = ''
+
+ if 'no_recv' not in kwargs:
+ enc = 'utf-8' if 'encoding' not in kwargs else kwargs['encoding']
+ resp = self.recvall(sock).decode(enc)
if '--verbose' in sys.argv:
print('<<<', resp.encode('utf-8'), sep='\n')