control.py (1730:44912af5b3e6) control.py (2073:bc6ad31ce286)
1import json
2
3from unit.http import TestHTTP
4from unit.option import option
5
6
7def args_handler(conf_func):
8 def args_wrapper(self, *args):

--- 16 unchanged lines hidden (view full) ---

25 arguments = (self, url) if conf is None else (self, conf, url)
26
27 return json.loads(conf_func(*arguments))
28
29 return args_wrapper
30
31
32class TestControl(TestHTTP):
1import json
2
3from unit.http import TestHTTP
4from unit.option import option
5
6
7def args_handler(conf_func):
8 def args_wrapper(self, *args):

--- 16 unchanged lines hidden (view full) ---

25 arguments = (self, url) if conf is None else (self, conf, url)
26
27 return json.loads(conf_func(*arguments))
28
29 return args_wrapper
30
31
32class TestControl(TestHTTP):
33
34 # TODO socket reuse
35 # TODO http client
36
37 @args_handler
38 def conf(self, conf, url):
39 return self.put(**self._get_args(url, conf))['body']
40
41 @args_handler
42 def conf_get(self, url):
43 return self.get(**self._get_args(url))['body']
44

--- 19 unchanged lines hidden ---
33 @args_handler
34 def conf(self, conf, url):
35 return self.put(**self._get_args(url, conf))['body']
36
37 @args_handler
38 def conf_get(self, url):
39 return self.get(**self._get_args(url))['body']
40

--- 19 unchanged lines hidden ---