Tests: style.

This commit is contained in:
Andrey Zelenkov
2018-01-15 19:57:28 +03:00
parent 84eba82bc8
commit 263741fb44

View File

@@ -211,19 +211,12 @@ class TestUnitControl(TestUnit):
class TestUnitHTTP(): class TestUnitHTTP():
@classmethod @classmethod
def http(self, method, host='127.0.0.1:7080', uri='/', **kwargs): def http(self, method, **kwargs):
if 'sess' in kwargs: host = '127.0.0.1:7080' if 'host' not in kwargs else kwargs['host']
sess = kwargs['sess'] uri = '/' if 'uri' not in kwargs else kwargs['uri']
else: sess = Session() if 'sess' not in kwargs else kwargs['sess']
sess = Session() body = None if 'body' not in kwargs else kwargs['body']
headers = None if 'headers' not in kwargs else kwargs['headers']
body = None
if 'body' in kwargs:
body = kwargs['body']
headers = None
if 'headers' in kwargs:
headers = kwargs['headers']
req = Request('POST', 'http://' + host + uri, headers=headers) req = Request('POST', 'http://' + host + uri, headers=headers)
prepped = req.prepare() prepped = req.prepare()