diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2024-01-15 15:48:58 +0000 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2024-01-15 15:48:58 +0000 |
commit | 5a8337933df1cf3aba967d86549e236dd9173386 (patch) | |
tree | 30842acf799fc521702b1c4b070332c72feaaa1c /test/test_proxy_chunked.py | |
parent | e95a91cbfac018b9877d9e389e614e9f2a9f1313 (diff) | |
download | unit-5a8337933df1cf3aba967d86549e236dd9173386.tar.gz unit-5a8337933df1cf3aba967d86549e236dd9173386.tar.bz2 |
Tests: pathlib used where appropriate
Also fixed various pylint errors and style issues.
Diffstat (limited to 'test/test_proxy_chunked.py')
-rw-r--r-- | test/test_proxy_chunked.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test_proxy_chunked.py b/test/test_proxy_chunked.py index f9e9fe10..23476cd9 100644 --- a/test/test_proxy_chunked.py +++ b/test/test_proxy_chunked.py @@ -4,6 +4,7 @@ import socket import time import pytest + from conftest import run_process from unit.applications.lang.python import ApplicationPython from unit.utils import waitforsocket @@ -52,7 +53,7 @@ def run_server(server_port): part = sock.recv(buff_size) data += part - if not len(part): + if not part: break return data @@ -80,7 +81,7 @@ def run_server(server_port): req = f'{req}{add}\r\n' for chunk in re.split(r'([@#])', req): - if chunk == '@' or chunk == '#': + if chunk in ('@', '#'): if chunk == '#': time.sleep(0.1) continue @@ -90,10 +91,10 @@ def run_server(server_port): connection.close() -def chunks(chunks): +def chunks(chunks_lst): body = '\r\n\r\n' - for l, c in chunks: + for l, c in chunks_lst: body = f'{body}{l}\r\n{c}\r\n' return f'{body}0\r\n\r\n' |