diff options
Diffstat (limited to 'libmproxy')
-rw-r--r-- | libmproxy/certutils.py | 5 | ||||
-rw-r--r-- | libmproxy/console/contentview.py | 9 | ||||
-rw-r--r-- | libmproxy/controller.py | 8 | ||||
-rw-r--r-- | libmproxy/dump.py | 5 | ||||
-rw-r--r-- | libmproxy/proxy.py | 1 |
5 files changed, 10 insertions, 18 deletions
diff --git a/libmproxy/certutils.py b/libmproxy/certutils.py index 6ce2ea09..31b1fa08 100644 --- a/libmproxy/certutils.py +++ b/libmproxy/certutils.py @@ -213,10 +213,7 @@ class SSLCert: return altnames -# begin nocover -def get_remote_cert(host, port): +def get_remote_cert(host, port): # pragma: no cover addr = socket.gethostbyname(host) s = ssl.get_server_certificate((addr, port)) return SSLCert(s) -# end nocover - diff --git a/libmproxy/console/contentview.py b/libmproxy/console/contentview.py index c897db85..e64cb4fa 100644 --- a/libmproxy/console/contentview.py +++ b/libmproxy/console/contentview.py @@ -236,11 +236,10 @@ def view_javascript(hdrs, content, limit): opts.indent_size = 2 try: res = jsbeautifier.beautify(content[:limit], opts) - # begin nocover - except: - # Bugs in jsbeautifier mean that it can trhow arbitrary errors. - return None - # end nocover + except: # pragma: no cover + # Bugs in jsbeautifier mean that it + # can throw arbitrary errors. + return None # pragma: no cover return "JavaScript", _view_text(res, len(content), limit) diff --git a/libmproxy/controller.py b/libmproxy/controller.py index 174a3c6e..f38d1edb 100644 --- a/libmproxy/controller.py +++ b/libmproxy/controller.py @@ -17,8 +17,6 @@ import Queue, threading should_exit = False -#begin nocover - class Msg: def __init__(self): self.q = Queue.Queue() @@ -36,13 +34,13 @@ class Msg: self.acked = False try: masterq.put(self, timeout=3) - while not should_exit: + while not should_exit: # pragma: no cover try: g = self.q.get(timeout=0.5) except Queue.Empty: continue return g - except (Queue.Empty, Queue.Full): + except (Queue.Empty, Queue.Full): # pragma: no cover return None @@ -88,7 +86,7 @@ class Master: self.tick(self.masterq) self.shutdown() - def handle(self, msg): + def handle(self, msg): # pragma: no cover c = "handle_" + msg.__class__.__name__.lower() m = getattr(self, c, None) if m: diff --git a/libmproxy/dump.py b/libmproxy/dump.py index 5781764c..36f54608 100644 --- a/libmproxy/dump.py +++ b/libmproxy/dump.py @@ -214,13 +214,12 @@ class DumpMaster(flow.FlowMaster): self._process_flow(f) return f -# begin nocover - def shutdown(self): + def shutdown(self): # pragma: no cover if self.o.wfile: self.fwriter.fo.close() return flow.FlowMaster.shutdown(self) - def run(self): + def run(self): # pragma: no cover if self.o.rfile and not self.o.keepserving: if self.script: self.load_script(None) diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index 2c0fa57b..9249de86 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -257,7 +257,6 @@ class FileLike: return result -#begin nocover class RequestReplayThread(threading.Thread): def __init__(self, config, flow, masterq): self.config, self.flow, self.masterq = config, flow, masterq |