diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-11-22 14:08:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 14:08:04 -0500 |
commit | 6d47b7e32589e816eb766446cc1ff19ea73fc7c1 (patch) | |
tree | 3990c590d8fe0d442233790779b7fa62816ca2b2 /tests/rest/admin | |
parent | Apply correct editorconfig to .pyi files (#14526) (diff) | |
download | synapse-6d47b7e32589e816eb766446cc1ff19ea73fc7c1.tar.xz |
Add a type hint for `get_device_handler()` and fix incorrect types. (#14055)
This was the last untyped handler from the HomeServer object. Since it was being treated as Any (and thus unchecked) it was being used incorrectly in a few places.
Diffstat (limited to 'tests/rest/admin')
-rw-r--r-- | tests/rest/admin/test_device.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/rest/admin/test_device.py b/tests/rest/admin/test_device.py index d52aee8f92..03f2112b07 100644 --- a/tests/rest/admin/test_device.py +++ b/tests/rest/admin/test_device.py @@ -19,6 +19,7 @@ from twisted.test.proto_helpers import MemoryReactor import synapse.rest.admin from synapse.api.errors import Codes +from synapse.handlers.device import DeviceHandler from synapse.rest.client import login from synapse.server import HomeServer from synapse.util import Clock @@ -34,7 +35,9 @@ class DeviceRestTestCase(unittest.HomeserverTestCase): ] def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None: - self.handler = hs.get_device_handler() + handler = hs.get_device_handler() + assert isinstance(handler, DeviceHandler) + self.handler = handler self.admin_user = self.register_user("admin", "pass", admin=True) self.admin_user_tok = self.login("admin", "pass") |