summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/tests/server/test__resource.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/testing/tests/server/test__resource.py b/testing/tests/server/test__resource.py
index c066435e..be02b5a1 100644
--- a/testing/tests/server/test__resource.py
+++ b/testing/tests/server/test__resource.py
@@ -35,22 +35,25 @@ _pool = reactor.getThreadPool()
class SoledadResourceTestCase(unittest.TestCase):
def test_get_root(self):
- enable_blobs = None # doesn't matter
- resource = SoledadResource(enable_blobs=enable_blobs, sync_pool=_pool)
+ blobs_resource = None # doesn't matter
+ resource = SoledadResource(
+ blobs_resource=blobs_resource, sync_pool=_pool)
request = DummyRequest([''])
child = getChildForRequest(resource, request)
self.assertIsInstance(child, ServerInfo)
def test_get_blobs_enabled(self):
- enable_blobs = True
- resource = SoledadResource(enable_blobs=enable_blobs, sync_pool=_pool)
+ blobs_resource = BlobsResource('/tmp')
+ resource = SoledadResource(
+ blobs_resource=blobs_resource, sync_pool=_pool)
request = DummyRequest(['blobs'])
child = getChildForRequest(resource, request)
self.assertIsInstance(child, BlobsResource)
def test_get_blobs_disabled(self):
- enable_blobs = False
- resource = SoledadResource(enable_blobs=enable_blobs, sync_pool=_pool)
+ blobs_resource = None
+ resource = SoledadResource(
+ blobs_resource=blobs_resource, sync_pool=_pool)
request = DummyRequest(['blobs'])
child = getChildForRequest(resource, request)
# if blobs is disabled, the request should be routed to sync
@@ -58,8 +61,9 @@ class SoledadResourceTestCase(unittest.TestCase):
self.assertIsInstance(child._application, GzipMiddleware)
def test_get_sync(self):
- enable_blobs = None # doesn't matter
- resource = SoledadResource(enable_blobs=enable_blobs, sync_pool=_pool)
+ blobs_resource = None # doesn't matter
+ resource = SoledadResource(
+ blobs_resource=blobs_resource, sync_pool=_pool)
request = DummyRequest(['user-db', 'sync-from', 'source-id'])
child = getChildForRequest(resource, request)
self.assertIsInstance(child, WSGIResource)