summaryrefslogtreecommitdiff
path: root/testing/tests
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2017-01-26 19:18:15 -0200
committerKali Kaneko <kali@leap.se>2017-02-09 17:41:45 +0100
commit47858d88ca4ca10ac363c71550b1bafe50f8f4ce (patch)
treeb5bffe1b526e55c3279498851bd1c2628d83291b /testing/tests
parent47c357213b4e39c6ced818de7eeb401e52bf92b9 (diff)
[refactor] allow passing threadpool pool for server sync resource
Conflicts: server/src/leap/soledad/server/_resource.py testing/tests/server/test__resource.py
Diffstat (limited to 'testing/tests')
-rw-r--r--testing/tests/server/test_auth.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/testing/tests/server/test_auth.py b/testing/tests/server/test_auth.py
index 8ef35177..f7fe0f25 100644
--- a/testing/tests/server/test_auth.py
+++ b/testing/tests/server/test_auth.py
@@ -23,6 +23,7 @@ from contextlib import contextmanager
from twisted.cred.credentials import UsernamePassword
from twisted.cred.error import UnauthorizedLogin
+from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from twisted.trial import unittest
from twisted.web.resource import IResource
@@ -37,7 +38,9 @@ from leap.soledad.server._resource import SoledadResource
class SoledadRealmTestCase(unittest.TestCase):
def test_returned_resource(self):
- realm = SoledadRealm()
+ # we have to pass a pool to the realm , otherwise tests will hang
+ pool = reactor.getThreadPool()
+ realm = SoledadRealm(sync_pool=pool)
iface, avatar, logout = realm.requestAvatar('any', None, IResource)
self.assertIsInstance(avatar, SoledadResource)
self.assertIsNone(logout())