aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-02-07 02:36:39 +0100
committerMaximilian Hils <git@maximilianhils.com>2014-02-07 02:36:39 +0100
commit9f5f2b707165d14cbf0ace9a55ec2d1dc44d9802 (patch)
treefaaabe2a4ec11607076217bacca1b9d8ae866b23 /libmproxy/protocol
parent66090f9aea01094a42c53c762ae5852b7ee91e86 (diff)
downloadmitmproxy-9f5f2b707165d14cbf0ace9a55ec2d1dc44d9802.tar.gz
mitmproxy-9f5f2b707165d14cbf0ace9a55ec2d1dc44d9802.tar.bz2
mitmproxy-9f5f2b707165d14cbf0ace9a55ec2d1dc44d9802.zip
test libmproxy.app, increase coverage
Diffstat (limited to 'libmproxy/protocol')
-rw-r--r--libmproxy/protocol/__init__.py6
-rw-r--r--libmproxy/protocol/http.py2
-rw-r--r--libmproxy/protocol/primitives.py6
3 files changed, 4 insertions, 10 deletions
diff --git a/libmproxy/protocol/__init__.py b/libmproxy/protocol/__init__.py
index 123c31e0..4c72ad48 100644
--- a/libmproxy/protocol/__init__.py
+++ b/libmproxy/protocol/__init__.py
@@ -15,14 +15,14 @@ class ProtocolHandler(object):
self.c = c
"""@type: libmproxy.proxy.ConnectionHandler"""
- def handle_messages(self):
+ def handle_messages(self): # pragma: nocover
"""
This method gets called if a client connection has been made. Depending on the proxy settings,
a server connection might already exist as well.
"""
raise NotImplementedError
- def handle_error(self, error):
+ def handle_error(self, error): # pragma: nocover
"""
This method gets called should there be an uncaught exception during the connection.
This might happen outside of handle_messages, e.g. if the initial SSL handshake fails in transparent mode.
@@ -90,7 +90,7 @@ def _handler(conntype, connection_handler):
if conntype in protocols:
return protocols[conntype]["handler"](connection_handler)
- raise NotImplementedError
+ raise NotImplementedError # pragma: nocover
def handle_messages(conntype, connection_handler):
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py
index 2a9f9afe..21624513 100644
--- a/libmproxy/protocol/http.py
+++ b/libmproxy/protocol/http.py
@@ -824,7 +824,7 @@ class HttpAuthenticationError(Exception):
def __init__(self, auth_headers=None):
self.auth_headers = auth_headers
- def __str__(self):
+ def __str__(self): # pragma: nocover
return "HttpAuthenticationError"
diff --git a/libmproxy/protocol/primitives.py b/libmproxy/protocol/primitives.py
index d1546ddd..673628bc 100644
--- a/libmproxy/protocol/primitives.py
+++ b/libmproxy/protocol/primitives.py
@@ -88,12 +88,6 @@ class Flow(stateobject.SimpleStateObject, BackreferenceMixin):
d.update(version=version.IVERSION)
return d
- @classmethod
- def _from_state(cls, state):
- f = cls(None, None, None)
- f._load_state(state)
- return f
-
def __eq__(self, other):
return self is other