Tests: style.

This commit is contained in:
Andrei Zeliankou
2021-04-05 14:03:05 +01:00
parent 46d8567dd7
commit 6c97a1a069
67 changed files with 689 additions and 614 deletions

View File

@@ -3,13 +3,15 @@ import time
from distutils.version import LooseVersion
import pytest
from unit.applications.lang.python import TestApplicationPython
from unit.option import option
class TestASGIApplication(TestApplicationPython):
prerequisites = {'modules': {'python':
lambda v: LooseVersion(v) >= LooseVersion('3.5')}}
prerequisites = {
'modules': {'python': lambda v: LooseVersion(v) >= LooseVersion('3.5')}
}
load_module = 'asgi'
def findall(self, pattern):
@@ -31,7 +33,8 @@ Content-Type: text/html
Connection: close
custom-header: BLAH
%s""" % (len(body), body.encode()),
%s"""
% (len(body), body.encode()),
raw=True,
)
@@ -145,7 +148,7 @@ custom-header: BLAH
assert 'success' in self.conf(
'{"http":{"max_body_size": ' + str(max_body_size) + ' }}',
'settings'
'settings',
)
assert self.get()['status'] == 200, 'init'
@@ -398,7 +401,7 @@ Connection: close
socks.append(sock)
time.sleep(1.0) # required to avoid greedy request reading
time.sleep(1.0) # required to avoid greedy request reading
threads = set()