From 3fb32423b75898f4eb0812c8927dd7f06839e756 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Sun, 12 Feb 2017 23:14:55 -0300 Subject: [tests] server parameter is gone, patch the module --- testing/tests/server/test_auth.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'testing') 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): -- cgit v1.2.3