summary refs log tree commit diff
path: root/tests/handlers/test_user_directory.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2022-04-01 17:04:16 +0100
committerGitHub <noreply@github.com>2022-04-01 16:04:16 +0000
commitf0b03186d96305fd44d74a89bf4230beec0c5c31 (patch)
tree3452c18b9205bc18584ea8b4fb43c4e8a2912fef /tests/handlers/test_user_directory.py
parentRemove redundant `get_success` calls in test code (#12346) (diff)
downloadsynapse-f0b03186d96305fd44d74a89bf4230beec0c5c31.tar.xz
Add type hints for `tests/unittest.py`. (#12347)
In particular, add type hints for get_success and friends, which are then helpful in a bunch of places.
Diffstat (limited to 'tests/handlers/test_user_directory.py')
-rw-r--r--tests/handlers/test_user_directory.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/handlers/test_user_directory.py b/tests/handlers/test_user_directory.py
index 92012cd6f7..c6e501c7be 100644
--- a/tests/handlers/test_user_directory.py
+++ b/tests/handlers/test_user_directory.py
@@ -351,6 +351,7 @@ class UserDirectoryTestCase(unittest.HomeserverTestCase):
             self.handler.handle_local_profile_change(regular_user_id, profile_info)
         )
         profile = self.get_success(self.store.get_user_in_directory(regular_user_id))
+        assert profile is not None
         self.assertTrue(profile["display_name"] == display_name)
 
     def test_handle_local_profile_change_with_deactivated_user(self) -> None:
@@ -369,6 +370,7 @@ class UserDirectoryTestCase(unittest.HomeserverTestCase):
 
         # profile is in directory
         profile = self.get_success(self.store.get_user_in_directory(r_user_id))
+        assert profile is not None
         self.assertTrue(profile["display_name"] == display_name)
 
         # deactivate user