diff options
Diffstat (limited to 'testing/tests/server/test_auth.py')
-rw-r--r-- | testing/tests/server/test_auth.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/testing/tests/server/test_auth.py b/testing/tests/server/test_auth.py index 00d416d5..c9b941f9 100644 --- a/testing/tests/server/test_auth.py +++ b/testing/tests/server/test_auth.py @@ -29,6 +29,7 @@ from twisted.trial import unittest from twisted.web.resource import IResource from twisted.web.test import test_httpauth +import leap.soledad.server.auth as auth_module from leap.soledad.server.auth import SoledadRealm from leap.soledad.server.auth import TokenChecker from leap.soledad.server.auth import TokenCredentialFactory @@ -73,7 +74,8 @@ class TokenCheckerTestCase(unittest.TestCase): token = {'user_id': 'user', 'type': 'Token'} server = dummy_server(token) # setup the checker with the custom server - checker = TokenChecker(server=server) + checker = TokenChecker() + auth_module.couch_server = lambda url: server # assert the checker *can* verify the creds creds = UsernamePassword('user', 'pass') avatarId = yield checker.requestAvatarId(creds) @@ -85,7 +87,8 @@ class TokenCheckerTestCase(unittest.TestCase): token = None server = dummy_server(token) # setup the checker with the custom server - checker = TokenChecker(server=server) + checker = TokenChecker() + auth_module.couch_server = lambda url: server # assert the checker *cannot* verify the creds creds = UsernamePassword('user', '') with self.assertRaises(UnauthorizedLogin): |