Tres Seaver
2009-05-08 2091d4d32d3e0fd1c1efc51a0f51c3bb9e87ec07
Coverage.
2 files modified
16 ■■■■■ changed files
repoze/who/plugins/htpasswd.py 3 ●●●● patch | view | raw | blame | history
repoze/who/plugins/tests/test_htpasswd.py 13 ●●●●● patch | view | raw | blame | history
repoze/who/plugins/htpasswd.py
@@ -42,7 +42,8 @@
        return None
    def __repr__(self):
        return '<%s %s>' % (self.__class__.__name__, id(self))
        return '<%s %s>' % (self.__class__.__name__,
                            id(self)) #pragma NO COVERAGE
def crypt_check(password, hashed):
    from crypt import crypt
repoze/who/plugins/tests/test_htpasswd.py
@@ -117,6 +117,19 @@
        self.assertEqual(crypt_check('password', hashed), True)
        self.assertEqual(crypt_check('notpassword', hashed), False)
    def test_plain_check(self):
        from repoze.who.plugins.htpasswd import plain_check
        self.failUnless(plain_check('password', 'password'))
        self.failIf(plain_check('notpassword', 'password'))
    def test_factory_no_filename_raises(self):
        from repoze.who.plugins.htpasswd import make_plugin
        self.assertRaises(ValueError, make_plugin)
    def test_factory_no_check_fn_raises(self):
        from repoze.who.plugins.htpasswd import make_plugin
        self.assertRaises(ValueError, make_plugin, 'foo')
    def test_factory(self):
        from repoze.who.plugins.htpasswd import make_plugin
        from repoze.who.plugins.htpasswd import crypt_check