| | |
| | | verifyClass(IAuthenticator, klass) |
| | | |
| | | def test_authenticate_nocreds(self): |
| | | from StringIO import StringIO |
| | | from repoze.who._compat import StringIO |
| | | io = StringIO() |
| | | plugin = self._makeOne(io, None) |
| | | environ = self._makeEnviron() |
| | | creds = {} |
| | | result = plugin.authenticate(environ, creds) |
| | | self.assertEqual(result, None) |
| | | |
| | | |
| | | def test_authenticate_nolines(self): |
| | | from StringIO import StringIO |
| | | from repoze.who._compat import StringIO |
| | | io = StringIO() |
| | | def check(password, hashed): |
| | | return True |
| | |
| | | creds = {'login':'chrism', 'password':'pass'} |
| | | result = plugin.authenticate(environ, creds) |
| | | self.assertEqual(result, None) |
| | | |
| | | |
| | | def test_authenticate_nousermatch(self): |
| | | from StringIO import StringIO |
| | | from repoze.who._compat import StringIO |
| | | io = StringIO('nobody:foo') |
| | | def check(password, hashed): |
| | | return True |
| | |
| | | self.assertEqual(result, None) |
| | | |
| | | def test_authenticate_match(self): |
| | | from StringIO import StringIO |
| | | from repoze.who._compat import StringIO |
| | | io = StringIO('chrism:pass') |
| | | def check(password, hashed): |
| | | return True |
| | |
| | | self.assertEqual(result, 'chrism') |
| | | |
| | | def test_authenticate_badline(self): |
| | | from StringIO import StringIO |
| | | from repoze.who._compat import StringIO |
| | | io = StringIO('badline\nchrism:pass') |
| | | def check(password, hashed): |
| | | return True |