summaryrefslogtreecommitdiffhomepage
path: root/test/test_proxy_chunked.py
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2023-05-10 10:29:16 -0700
committerKonstantin Pavlov <thresh@nginx.com>2023-05-10 10:29:16 -0700
commit69235c513277c64b513447d9b92c3c03d616f577 (patch)
tree0780c92ba28d92b547c85ea0bee5e3040e14dee2 /test/test_proxy_chunked.py
parentb9bc222021e77bbdfb12576b3e315b962cf6b399 (diff)
parentfaf97dc06058de1c929af33a68adb34d3932b374 (diff)
downloadunit-1.30.0-1.tar.gz
unit-1.30.0-1.tar.bz2
Merged with the default branch.1.30.0-1
Diffstat (limited to '')
-rw-r--r--test/test_proxy_chunked.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/test_proxy_chunked.py b/test/test_proxy_chunked.py
index f024eaf5..f31c976a 100644
--- a/test/test_proxy_chunked.py
+++ b/test/test_proxy_chunked.py
@@ -61,7 +61,7 @@ class TestProxyChunked(TestApplicationPython):
else:
add = line
- req = req + add + '\r\n'
+ req = f'{req}{add}\r\n'
for chunk in re.split(r'([@#])', req):
if chunk == '@' or chunk == '#':
@@ -77,9 +77,9 @@ class TestProxyChunked(TestApplicationPython):
body = '\r\n\r\n'
for l, c in chunks:
- body = body + l + '\r\n' + c + '\r\n'
+ body = f'{body}{l}\r\n{c}\r\n'
- return body + '0\r\n\r\n'
+ return f'{body}0\r\n\r\n'
def get_http10(self, *args, **kwargs):
return self.get(*args, http_10=True, **kwargs)
@@ -96,7 +96,7 @@ class TestProxyChunked(TestApplicationPython):
"routes": [
{
"action": {
- "proxy": "http://127.0.0.1:" + str(self.SERVER_PORT)
+ "proxy": f'http://127.0.0.1:{self.SERVER_PORT}'
}
}
],
@@ -111,20 +111,20 @@ class TestProxyChunked(TestApplicationPython):
part = '0123456789abcdef'
assert (
- self.get_http10(body=self.chunks([('1000', part + ' X 256')]))[
+ self.get_http10(body=self.chunks([('1000', f'{part} X 256')]))[
'body'
]
== part * 256
)
assert (
- self.get_http10(body=self.chunks([('100000', part + ' X 65536')]))[
+ self.get_http10(body=self.chunks([('100000', f'{part} X 65536')]))[
'body'
]
== part * 65536
)
assert (
self.get_http10(
- body=self.chunks([('1000000', part + ' X 1048576')]),
+ body=self.chunks([('1000000', f'{part} X 1048576')]),
read_buffer_size=4096 * 4096,
)['body']
== part * 1048576
@@ -133,7 +133,7 @@ class TestProxyChunked(TestApplicationPython):
assert (
self.get_http10(
body=self.chunks(
- [('1000', part + ' X 256'), ('1000', part + ' X 256')]
+ [('1000', f'{part} X 256'), ('1000', f'{part} X 256')]
)
)['body']
== part * 256 * 2
@@ -142,8 +142,8 @@ class TestProxyChunked(TestApplicationPython):
self.get_http10(
body=self.chunks(
[
- ('100000', part + ' X 65536'),
- ('100000', part + ' X 65536'),
+ ('100000', f'{part} X 65536'),
+ ('100000', f'{part} X 65536'),
]
)
)['body']
@@ -153,8 +153,8 @@ class TestProxyChunked(TestApplicationPython):
self.get_http10(
body=self.chunks(
[
- ('1000000', part + ' X 1048576'),
- ('1000000', part + ' X 1048576'),
+ ('1000000', f'{part} X 1048576'),
+ ('1000000', f'{part} X 1048576'),
]
),
read_buffer_size=4096 * 4096,