summaryrefslogtreecommitdiff
path: root/testing/tests
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-02-12 23:14:55 -0300
committerKali Kaneko <kali@leap.se>2017-02-13 12:20:16 +0100
commit3fb32423b75898f4eb0812c8927dd7f06839e756 (patch)
treeafd1a37d987f8f796ff17db78bccae23cf6f7524 /testing/tests
parent1a5b292bd1fbd57b0b3127857e74bdf1ac22a7c6 (diff)
[tests] server parameter is gone, patch the module
Diffstat (limited to 'testing/tests')
-rw-r--r--testing/tests/server/test_auth.py7
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):