diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-06-21 15:39:40 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-06-21 15:39:40 +1200 |
commit | f0fd33fb11513a3e74079eaed5f5c1b8bb4e561d (patch) | |
tree | e14e24d4aa5b2ed24a96cc5af87f6ff5ac7e3a91 /libpathod/test.py | |
parent | 12c140b951705c08131cc4b86a247bccc9c493c0 (diff) | |
download | mitmproxy-f0fd33fb11513a3e74079eaed5f5c1b8bb4e561d.tar.gz mitmproxy-f0fd33fb11513a3e74079eaed5f5c1b8bb4e561d.tar.bz2 mitmproxy-f0fd33fb11513a3e74079eaed5f5c1b8bb4e561d.zip |
Log inspection and manipulation from tests.
Diffstat (limited to 'libpathod/test.py')
-rw-r--r-- | libpathod/test.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libpathod/test.py b/libpathod/test.py index 5fba17d5..943fe3c0 100644 --- a/libpathod/test.py +++ b/libpathod/test.py @@ -14,10 +14,30 @@ class Daemon: self.urlbase = "%s://%s:%s"%("https" if ssl else "http", IFACE, self.port) def info(self): + """ + Return some basic info about the remote daemon. + """ resp = requests.get("%s/api/info"%self.urlbase, verify=False) return resp.json + def log(self): + """ + Return the log buffer as a list of dictionaries. + """ + 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) + return resp.ok + def shutdown(self): + """ + Shut the daemon down, return after the thread has exited. + """ self.thread.server.shutdown() self.thread.join() |