diff options
author | Dan Callahan <d.callahan@f5.com> | 2024-02-27 15:15:42 +0000 |
---|---|---|
committer | Dan Callahan <d.callahan@f5.com> | 2024-02-27 15:15:42 +0000 |
commit | d76761901c4084bcdbc5a449e9bbb47d56b7093c (patch) | |
tree | b4b7b4e3d588b73a2adcc0094cab466d9194c679 /test/test_proxy_chunked.py | |
parent | c43629880472bba8d389dfb0b7ae6d883b0ba499 (diff) | |
parent | 088117008c9e8f397a58cc8d8070ce047beff12f (diff) | |
download | unit-d76761901c4084bcdbc5a449e9bbb47d56b7093c.tar.gz unit-d76761901c4084bcdbc5a449e9bbb47d56b7093c.tar.bz2 |
Merge tag '1.32.0' into branches/packaging1.32.0-1
Unit 1.32.0 release.
Diffstat (limited to 'test/test_proxy_chunked.py')
-rw-r--r-- | test/test_proxy_chunked.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/test_proxy_chunked.py b/test/test_proxy_chunked.py index a066e1e8..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 @@ -22,7 +23,7 @@ def setup_method_fixture(): assert 'success' in client.conf( { "listeners": { - "*:7080": {"pass": "routes"}, + "*:8080": {"pass": "routes"}, }, "routes": [ {"action": {"proxy": f'http://127.0.0.1:{SERVER_PORT}'}} @@ -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' |