summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-11-16 15:22:40 +0000
committerGitHub <noreply@github.com>2020-11-16 15:22:40 +0000
commitbebfb9a97b4e6a5cc840dc6906e4aaebd5d7d30d (patch)
tree307ea9eba33d0301b39b79e0e0f9c2913b1418b0 /tests/unittest.py
parentchangelog (diff)
parentRename `create_test_json_resource` to `create_test_resource` (#8759) (diff)
downloadsynapse-bebfb9a97b4e6a5cc840dc6906e4aaebd5d7d30d.tar.xz
Merge branch 'develop' into rav/pass_site_to_make_request
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/unittest.py b/tests/unittest.py
index 3e656b7b12..e39cb8dec9 100644
--- a/tests/unittest.py
+++ b/tests/unittest.py
@@ -30,6 +30,7 @@ from twisted.internet.defer import Deferred, ensureDeferred, succeed
 from twisted.python.failure import Failure
 from twisted.python.threadpool import ThreadPool
 from twisted.trial import unittest
+from twisted.web.resource import Resource
 
 from synapse.api.constants import EventTypes, Membership
 from synapse.config.homeserver import HomeServerConfig
@@ -239,10 +240,8 @@ class HomeserverTestCase(TestCase):
         if not isinstance(self.hs, HomeServer):
             raise Exception("A homeserver wasn't returned, but %r" % (self.hs,))
 
-        # Register the resources
-        self.resource = self.create_test_json_resource()
-
-        # create a site to wrap the resource.
+        # create the root resource, and a site to wrap it.
+        self.resource = self.create_test_resource()
         self.site = SynapseSite(
             logger_name="synapse.access.http.fake",
             site_tag=self.hs.config.server.server_name,
@@ -323,15 +322,12 @@ class HomeserverTestCase(TestCase):
         hs = self.setup_test_homeserver()
         return hs
 
-    def create_test_json_resource(self):
+    def create_test_resource(self) -> Resource:
         """
-        Create a test JsonResource, with the relevant servlets registerd to it
-
-        The default implementation calls each function in `servlets` to do the
-        registration.
+        Create a the root resource for the test server.
 
-        Returns:
-            JsonResource:
+        The default implementation creates a JsonResource and calls each function in
+        `servlets` to register servletes against it
         """
         resource = JsonResource(self.hs)