Tres Seaver
2009-05-08 719cb97efe037844924d1bd9e820d2cd27d1e3a3
Coverage.
2 files modified
16 ■■■■■ changed files
repoze/who/plugins/sql.py 12 ●●●● patch | view | raw | blame | history
repoze/who/plugins/tests/test_sql.py 4 ●●●● patch | view | raw | blame | history
repoze/who/plugins/sql.py
@@ -6,8 +6,8 @@
def default_password_compare(cleartext_password, stored_password_hash):
    try:
        from hashlib import sha1
    except ImportError: # Python < 2.5
        from sha import new as sha1
    except ImportError: # Python < 2.5 #pragma NO COVERAGE
        from sha import new as sha1    #pragma NO COVERAGE
    # the stored password is stored as '{SHA}<SHA hexdigest>'.
    # or as a cleartext password (no {SHA} prefix)
@@ -25,10 +25,10 @@
def make_psycopg_conn_factory(**kw):
    # convenience (I always seem to use Postgres)
    def conn_factory():
        import psycopg2
        return psycopg2.connect(kw['repoze.who.dsn'])
    return conn_factory
    def conn_factory(): #pragma NO COVERAGE
        import psycopg2 #pragma NO COVERAGE
        return psycopg2.connect(kw['repoze.who.dsn']) #pragma NO COVERAGE
    return conn_factory #pragma NO COVERAGE
class SQLAuthenticatorPlugin:
    implements(IAuthenticator)
repoze/who/plugins/tests/test_sql.py
@@ -185,6 +185,10 @@
        f = self._getFUT()
        self.assertRaises(ValueError, f, 'name', None, None)
    def test_no_connfactory(self):
        f = self._getFUT()
        self.assertRaises(ValueError, f, 'name', 'statement', None)
    def test_bad_connfactory(self):
        f = self._getFUT()
        self.assertRaises(ValueError, f, 'name', 'statement',