Tres Seaver
2012-11-06 87e79df73febeb83bf31d9b45f4c0f169a639a10
PEP8
2 files modified
8 ■■■■■ changed files
repoze/who/plugins/htpasswd.py 2 ●●● patch | view | raw | blame | history
repoze/who/plugins/tests/test_htpasswd.py 6 ●●●●● patch | view | raw | blame | history
repoze/who/plugins/htpasswd.py
@@ -100,7 +100,7 @@
    from hashlib import sha1
    import base64
    encrypted_string = base64.standard_b64encode(sha1(password).digest())
    return _same_string(hashed, "%s%s" % ("{SHA}",encrypted_string))
    return _same_string(hashed, "%s%s" % ("{SHA}", encrypted_string))
def plain_check(password, hashed):
    return _same_string(password, hashed)
repoze/who/plugins/tests/test_htpasswd.py
@@ -134,8 +134,10 @@
        from repoze.who.plugins.htpasswd import sha1_check
        encrypted_string = base64.standard_b64encode(sha1("password").digest())
        self.assertEqual(sha1_check('password', "%s%s" % ("{SHA}",encrypted_string)), True)
        self.assertEqual(sha1_check('notpassword', "%s%s" % ("{SHA}", encrypted_string)), False)
        self.assertEqual(sha1_check('password',
                         "%s%s" % ("{SHA}",encrypted_string)), True)
        self.assertEqual(sha1_check('notpassword',
                         "%s%s" % ("{SHA}", encrypted_string)), False)
    def test_plain_check(self):
        from repoze.who.plugins.htpasswd import plain_check