aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/test.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-05-30 12:03:13 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-05-30 12:03:13 +1200
commit4ed5043c67848bf717e48bc509d959422c8faeb6 (patch)
tree92abe731c72d34bf6b43cbe1ecb46939953a6860 /libpathod/test.py
parent904760c6c2927caf49b7cbe4027dd1c8dd8e9fdb (diff)
downloadmitmproxy-4ed5043c67848bf717e48bc509d959422c8faeb6.tar.gz
mitmproxy-4ed5043c67848bf717e48bc509d959422c8faeb6.tar.bz2
mitmproxy-4ed5043c67848bf717e48bc509d959422c8faeb6.zip
Add coding style check, reformat.
Diffstat (limited to 'libpathod/test.py')
-rw-r--r--libpathod/test.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/libpathod/test.py b/libpathod/test.py
index 6f95a797..136a6237 100644
--- a/libpathod/test.py
+++ b/libpathod/test.py
@@ -9,12 +9,13 @@ requests.packages.urllib3.disable_warnings()
class Daemon:
IFACE = "127.0.0.1"
+
def __init__(self, ssl=None, **daemonargs):
self.q = Queue.Queue()
self.thread = _PaThread(self.IFACE, self.q, ssl, daemonargs)
self.thread.start()
self.port = self.q.get(True, 5)
- self.urlbase = "%s://%s:%s"%(
+ self.urlbase = "%s://%s:%s" % (
"https" if ssl else "http",
self.IFACE,
self.port
@@ -31,13 +32,13 @@ class Daemon:
"""
Return a URL that will render the response in spec.
"""
- return "%s/p/%s"%(self.urlbase, spec)
+ return "%s/p/%s" % (self.urlbase, spec)
def info(self):
"""
Return some basic info about the remote daemon.
"""
- resp = requests.get("%s/api/info"%self.urlbase, verify=False)
+ resp = requests.get("%s/api/info" % self.urlbase, verify=False)
return resp.json()
def last_log(self):
@@ -53,14 +54,14 @@ class Daemon:
"""
Return the log buffer as a list of dictionaries.
"""
- resp = requests.get("%s/api/log"%self.urlbase, verify=False)
+ resp = requests.get("%s/api/log" % self.urlbase, verify=False)
return resp.json()["log"]
def clear_log(self):
"""
Clear the log.
"""
- resp = requests.get("%s/api/clear_log"%self.urlbase, verify=False)
+ resp = requests.get("%s/api/clear_log" % self.urlbase, verify=False)
return resp.ok
def shutdown(self):