diff --git a/netlib/http_auth.py b/netlib/http_auth.py index d478ab1..4adae17 100644 --- a/netlib/http_auth.py +++ b/netlib/http_auth.py @@ -96,7 +96,7 @@ def __init__(self, fp): 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 485d821..07b28cf 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -298,7 +298,7 @@ def finish(self): 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 1c89900..05dfdb8 100644 --- a/test/test_http.py +++ b/test/test_http.py @@ -2,6 +2,7 @@ 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 0000000..7b8a643 --- /dev/null +++ b/test/test_imports.py @@ -0,0 +1,3 @@ +# These are actually tests! +import netlib.http_status +import netlib.version