summaryrefslogtreecommitdiffhomepage
path: root/test/unit
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2022-04-11 21:05:14 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2022-04-11 21:05:14 +0100
commit0f725346603f4de4473d12da502104b188ac02a4 (patch)
tree7f8254a816965d49c4d6d98da34f00c81894f7e8 /test/unit
parentaeed86c6829c62359e79f239b849766efb8857a7 (diff)
downloadunit-0f725346603f4de4473d12da502104b188ac02a4.tar.gz
unit-0f725346603f4de4473d12da502104b188ac02a4.tar.bz2
Tests: style.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/applications/lang/go.py7
-rw-r--r--test/unit/applications/websockets.py10
-rw-r--r--test/unit/control.py4
-rw-r--r--test/unit/http.py4
4 files changed, 11 insertions, 14 deletions
diff --git a/test/unit/applications/lang/go.py b/test/unit/applications/lang/go.py
index 67501e9c..04af26e1 100644
--- a/test/unit/applications/lang/go.py
+++ b/test/unit/applications/lang/go.py
@@ -24,8 +24,8 @@ class TestApplicationGo(TestApplicationProto):
env['GOCACHE'] = cache_dir
shutil.copy2(
- option.test_dir + '/go/' + script + '/' + name + '.go',
- temp_dir)
+ option.test_dir + '/go/' + script + '/' + name + '.go', temp_dir
+ )
if static:
args = [
@@ -55,7 +55,8 @@ class TestApplicationGo(TestApplicationProto):
f"""module test/app
require unit.nginx.org/go v0.0.0
replace unit.nginx.org/go => {replace_path}
-""")
+"""
+ )
if option.detailed:
print("\n$ GOPATH=" + env['GOPATH'] + " " + " ".join(args))
diff --git a/test/unit/applications/websockets.py b/test/unit/applications/websockets.py
index aa83339c..d647ce9b 100644
--- a/test/unit/applications/websockets.py
+++ b/test/unit/applications/websockets.py
@@ -43,7 +43,11 @@ class TestApplicationWebsocket(TestApplicationProto):
'Sec-WebSocket-Version': 13,
}
- _, sock = self.get(headers=headers, no_recv=True, start=True,)
+ _, sock = self.get(
+ headers=headers,
+ no_recv=True,
+ start=True,
+ )
resp = ''
while True:
@@ -218,9 +222,7 @@ class TestApplicationWebsocket(TestApplicationProto):
while pos < message_len:
end = min(pos + fragmention_size, message_len)
fin = end == message_len
- self.frame_write(
- sock, op_code, message[pos:end], fin=fin, **kwargs
- )
+ self.frame_write(sock, op_code, message[pos:end], fin=fin, **kwargs)
op_code = self.OP_CONT
pos = end
diff --git a/test/unit/control.py b/test/unit/control.py
index 3008a64b..99436ca0 100644
--- a/test/unit/control.py
+++ b/test/unit/control.py
@@ -30,10 +30,6 @@ def args_handler(conf_func):
class TestControl(TestHTTP):
-
- # TODO socket reuse
- # TODO http client
-
@args_handler
def conf(self, conf, url):
return self.put(**self._get_args(url, conf))['body']
diff --git a/test/unit/http.py b/test/unit/http.py
index dcfcd232..b4a1a17b 100644
--- a/test/unit/http.py
+++ b/test/unit/http.py
@@ -328,9 +328,7 @@ class TestHTTP:
datatype = value['type']
if not isinstance(value['data'], io.IOBase):
- pytest.fail(
- 'multipart encoding of file requires a stream.'
- )
+ pytest.fail('multipart encoding of file requires a stream.')
data = value['data'].read()