diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2013-03-03 12:16:09 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2013-03-03 12:16:09 +1300 |
commit | 1fe1a802adbef93b5b024a85d8dafb112ed652bb (patch) | |
tree | 2fdfec5c63eb81f6c438f00c62dcb7df25500db5 | |
parent | 0acab862a65ef4a1823a1bfb702d8be1e3d7b83d (diff) | |
download | mitmproxy-1fe1a802adbef93b5b024a85d8dafb112ed652bb.tar.gz mitmproxy-1fe1a802adbef93b5b024a85d8dafb112ed652bb.tar.bz2 mitmproxy-1fe1a802adbef93b5b024a85d8dafb112ed652bb.zip |
100% test coverage.
-rw-r--r-- | netlib/http_auth.py | 2 | ||||
-rw-r--r-- | netlib/tcp.py | 2 | ||||
-rw-r--r-- | test/test_http.py | 1 | ||||
-rw-r--r-- | test/test_imports.py | 3 |
4 files changed, 6 insertions, 2 deletions
diff --git a/netlib/http_auth.py b/netlib/http_auth.py index d478ab10..4adae179 100644 --- a/netlib/http_auth.py +++ b/netlib/http_auth.py @@ -96,7 +96,7 @@ class PassManHtpasswd: salt = parts[2], hashed_password = parts[3] ) - + def test(self, username, password_token): ui = self.usernames.get(username) if not ui: diff --git a/netlib/tcp.py b/netlib/tcp.py index 485d821f..07b28cf9 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -298,7 +298,7 @@ class BaseHandler: self.close() self.wfile.close() self.rfile.close() - except socket.error: + except (socket.error, NetLibDisconnect): # Remote has disconnected pass diff --git a/test/test_http.py b/test/test_http.py index 1c89900c..05dfdb8f 100644 --- a/test/test_http.py +++ b/test/test_http.py @@ -2,6 +2,7 @@ import cStringIO, textwrap, binascii from netlib import http, odict import tutils + def test_httperror(): e = http.HttpError(404, "Not found") assert str(e) diff --git a/test/test_imports.py b/test/test_imports.py new file mode 100644 index 00000000..7b8a643b --- /dev/null +++ b/test/test_imports.py @@ -0,0 +1,3 @@ +# These are actually tests! +import netlib.http_status +import netlib.version |