summaryrefslogtreecommitdiff
path: root/testing/tests/server/test__resource.py
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-08-29 17:05:02 -0300
committerdrebs <drebs@riseup.net>2017-09-05 11:08:47 -0300
commitda26a7f22c6ea77bc417d1184c2a0a4f976669a2 (patch)
treede5e7a86731690a202662120caef64c217a7c607 /testing/tests/server/test__resource.py
parent508fa68d7a2a7d7ef68a39df33b4c57e2260dfe6 (diff)
[style] improve naming and fixes from code review
-- Related: #8867
Diffstat (limited to 'testing/tests/server/test__resource.py')
-rw-r--r--testing/tests/server/test__resource.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/testing/tests/server/test__resource.py b/testing/tests/server/test__resource.py
index f5331e35..a43ac19f 100644
--- a/testing/tests/server/test__resource.py
+++ b/testing/tests/server/test__resource.py
@@ -23,7 +23,7 @@ from twisted.web.wsgi import WSGIResource
from twisted.web.resource import getChildForRequest
from twisted.internet import reactor
-from leap.soledad.server._resource import SoledadResource
+from leap.soledad.server._resource import PublicResource
from leap.soledad.server._resource import LocalResource
from leap.soledad.server._server_info import ServerInfo
from leap.soledad.server._blobs import BlobsResource
@@ -34,11 +34,11 @@ from leap.soledad.server.gzip_middleware import GzipMiddleware
_pool = reactor.getThreadPool()
-class SoledadResourceTestCase(unittest.TestCase):
+class PublicResourceTestCase(unittest.TestCase):
def test_get_root(self):
blobs_resource = None # doesn't matter
- resource = SoledadResource(
+ resource = PublicResource(
blobs_resource=blobs_resource, sync_pool=_pool)
request = DummyRequest([''])
child = getChildForRequest(resource, request)
@@ -46,7 +46,7 @@ class SoledadResourceTestCase(unittest.TestCase):
def test_get_blobs_enabled(self):
blobs_resource = BlobsResource("filesystem", '/tmp')
- resource = SoledadResource(
+ resource = PublicResource(
blobs_resource=blobs_resource, sync_pool=_pool)
request = DummyRequest(['blobs'])
child = getChildForRequest(resource, request)
@@ -54,7 +54,7 @@ class SoledadResourceTestCase(unittest.TestCase):
def test_get_blobs_disabled(self):
blobs_resource = None
- resource = SoledadResource(
+ resource = PublicResource(
blobs_resource=blobs_resource, sync_pool=_pool)
request = DummyRequest(['blobs'])
child = getChildForRequest(resource, request)
@@ -64,7 +64,7 @@ class SoledadResourceTestCase(unittest.TestCase):
def test_get_sync(self):
blobs_resource = None # doesn't matter
- resource = SoledadResource(
+ resource = PublicResource(
blobs_resource=blobs_resource, sync_pool=_pool)
request = DummyRequest(['user-db', 'sync-from', 'source-id'])
child = getChildForRequest(resource, request)
@@ -72,9 +72,10 @@ class SoledadResourceTestCase(unittest.TestCase):
self.assertIsInstance(child._application, GzipMiddleware)
def test_no_incoming_on_public_resource(self):
- resource = SoledadResource(None, sync_pool=_pool)
+ resource = PublicResource(None, sync_pool=_pool)
request = DummyRequest(['incoming'])
child = getChildForRequest(resource, request)
+ # WSGIResource is returned if a path is unknown
self.assertIsInstance(child, WSGIResource)
def test_get_incoming(self):