diff options
Diffstat (limited to 'testing/tests')
-rw-r--r-- | testing/tests/server/test__resource.py | 16 | ||||
-rw-r--r-- | testing/tests/server/test_auth.py | 3 |
2 files changed, 10 insertions, 9 deletions
diff --git a/testing/tests/server/test__resource.py b/testing/tests/server/test__resource.py index 30ef782d..c066435e 100644 --- a/testing/tests/server/test__resource.py +++ b/testing/tests/server/test__resource.py @@ -35,22 +35,22 @@ _pool = reactor.getThreadPool() class SoledadResourceTestCase(unittest.TestCase): def test_get_root(self): - conf = {'soledad-server': {'blobs': None}} # doesn't matter - resource = SoledadResource(conf, sync_pool=_pool) + enable_blobs = None # doesn't matter + resource = SoledadResource(enable_blobs=enable_blobs, sync_pool=_pool) request = DummyRequest(['']) child = getChildForRequest(resource, request) self.assertIsInstance(child, ServerInfo) def test_get_blobs_enabled(self): - conf = {'soledad-server': {'blobs': True}} - resource = SoledadResource(conf, sync_pool=_pool) + enable_blobs = True + resource = SoledadResource(enable_blobs=enable_blobs, sync_pool=_pool) request = DummyRequest(['blobs']) child = getChildForRequest(resource, request) self.assertIsInstance(child, BlobsResource) def test_get_blobs_disabled(self): - conf = {'soledad-server': {'blobs': False}} - resource = SoledadResource(conf, sync_pool=_pool) + enable_blobs = False + resource = SoledadResource(enable_blobs=enable_blobs, sync_pool=_pool) request = DummyRequest(['blobs']) child = getChildForRequest(resource, request) # if blobs is disabled, the request should be routed to sync @@ -58,8 +58,8 @@ class SoledadResourceTestCase(unittest.TestCase): self.assertIsInstance(child._application, GzipMiddleware) def test_get_sync(self): - conf = {'soledad-server': {'blobs': None}} # doesn't matter - resource = SoledadResource(conf, sync_pool=_pool) + enable_blobs = None # doesn't matter + resource = SoledadResource(enable_blobs=enable_blobs, sync_pool=_pool) request = DummyRequest(['user-db', 'sync-from', 'source-id']) child = getChildForRequest(resource, request) self.assertIsInstance(child, WSGIResource) diff --git a/testing/tests/server/test_auth.py b/testing/tests/server/test_auth.py index f7fe0f25..00d416d5 100644 --- a/testing/tests/server/test_auth.py +++ b/testing/tests/server/test_auth.py @@ -39,8 +39,9 @@ class SoledadRealmTestCase(unittest.TestCase): def test_returned_resource(self): # we have to pass a pool to the realm , otherwise tests will hang + conf = {'soledad-server': {'blobs': False}} pool = reactor.getThreadPool() - realm = SoledadRealm(sync_pool=pool) + realm = SoledadRealm(conf=conf, sync_pool=pool) iface, avatar, logout = realm.requestAvatar('any', None, IResource) self.assertIsInstance(avatar, SoledadResource) self.assertIsNone(logout()) |