summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2021-09-30 11:04:40 +0100
committerGitHub <noreply@github.com>2021-09-30 11:04:40 +0100
commit3aefc7b66d9c7fb98addc71eaf5ef501a4c6a583 (patch)
treeea5fba5e1ee0bafb997e08ad8a1dc56d841b44fb /tests/unittest.py
parentSplit `event_auth.check` into two parts (#10940) (diff)
downloadsynapse-3aefc7b66d9c7fb98addc71eaf5ef501a4c6a583.tar.xz
Refactor user directory tests (#10935)
* Pull out GetUserDirectoryTables helper
* Don't rebuild the dir in tests that don't need it

In #10796 I changed registering a user to add directory entries under.
This means we don't have to force a directory regbuild in to tests of
the user directory search.

* Move test_initial to tests/storage
* Add type hints to both test_user_directory files

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Diffstat (limited to '')
-rw-r--r--tests/unittest.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/unittest.py b/tests/unittest.py

index 6d5d87cb78..5f93ebf147 100644 --- a/tests/unittest.py +++ b/tests/unittest.py
@@ -28,6 +28,7 @@ from canonicaljson import json from twisted.internet.defer import Deferred, ensureDeferred, succeed from twisted.python.failure import Failure from twisted.python.threadpool import ThreadPool +from twisted.test.proto_helpers import MemoryReactor from twisted.trial import unittest from twisted.web.resource import Resource @@ -46,6 +47,7 @@ from synapse.logging.context import ( ) from synapse.server import HomeServer from synapse.types import UserID, create_requester +from synapse.util import Clock from synapse.util.httpresourcetree import create_resource_tree from synapse.util.ratelimitutils import FederationRateLimiter @@ -371,7 +373,7 @@ class HomeserverTestCase(TestCase): return config - def prepare(self, reactor, clock, homeserver): + def prepare(self, reactor: MemoryReactor, clock: Clock, homeserver: HomeServer): """ Prepare for the test. This involves things like mocking out parts of the homeserver, or building test data common across the whole test