summaryrefslogtreecommitdiffhomepage
path: root/test/unit.py
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2018-01-15 19:57:28 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2018-01-15 19:57:28 +0300
commit263741fb445468eb7123bad0f7c46c1fdf6087a8 (patch)
tree7e053f6d77aee292e6c2deb7ded277803d7f1f6c /test/unit.py
parent84eba82bc8d0511cb06aba17c731796320818df5 (diff)
downloadunit-263741fb445468eb7123bad0f7c46c1fdf6087a8.tar.gz
unit-263741fb445468eb7123bad0f7c46c1fdf6087a8.tar.bz2
Tests: style.
Diffstat (limited to '')
-rw-r--r--test/unit.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/test/unit.py b/test/unit.py
index 2061e3e1..a119b030 100644
--- a/test/unit.py
+++ b/test/unit.py
@@ -211,19 +211,12 @@ class TestUnitControl(TestUnit):
class TestUnitHTTP():
@classmethod
- def http(self, method, host='127.0.0.1:7080', uri='/', **kwargs):
- if 'sess' in kwargs:
- sess = kwargs['sess']
- else:
- sess = Session()
-
- body = None
- if 'body' in kwargs:
- body = kwargs['body']
-
- headers = None
- if 'headers' in kwargs:
- headers = kwargs['headers']
+ def http(self, method, **kwargs):
+ host = '127.0.0.1:7080' if 'host' not in kwargs else kwargs['host']
+ uri = '/' if 'uri' not in kwargs else kwargs['uri']
+ sess = Session() if 'sess' not in kwargs else kwargs['sess']
+ body = None if 'body' not in kwargs else kwargs['body']
+ headers = None if 'headers' not in kwargs else kwargs['headers']
req = Request('POST', 'http://' + host + uri, headers=headers)
prepped = req.prepare()