100% test coverage.

This commit is contained in:
Aldo Cortesi 2013-03-03 12:16:09 +13:00
parent 0acab862a6
commit 1fe1a802ad
4 changed files with 6 additions and 2 deletions

View File

@ -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:

View File

@ -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

View File

@ -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)

3
test/test_imports.py Normal file
View File

@ -0,0 +1,3 @@
# These are actually tests!
import netlib.http_status
import netlib.version