diff options
author | David Robertson <davidr@element.io> | 2021-09-24 10:38:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-24 10:38:22 +0100 |
commit | 7f3352743e02e0d02ec00eb3a50fd0ceb422286c (patch) | |
tree | 89c43e76587512528da6b175461b0d24903379bb /tests/handlers/test_user_directory.py | |
parent | In `_purge_history_txn`, ensure that txn.fetchall has elements before accessi... (diff) | |
download | synapse-7f3352743e02e0d02ec00eb3a50fd0ceb422286c.tar.xz |
Improve typing in user_directory files (#10891)
* Improve typing in user_directory files This makes the user_directory.py in storage pass most of mypy's checks (including `no-untyped-defs`). Unfortunately that file is in the tangled web of Store class inheritance so doesn't pass mypy at the moment. The handlers directory has already been mypyed. Co-authored-by: reivilibre <olivier@librepush.net>
Diffstat (limited to 'tests/handlers/test_user_directory.py')
-rw-r--r-- | tests/handlers/test_user_directory.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/handlers/test_user_directory.py b/tests/handlers/test_user_directory.py index f3684c34a2..ba32585a14 100644 --- a/tests/handlers/test_user_directory.py +++ b/tests/handlers/test_user_directory.py @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +from typing import List, Tuple from unittest.mock import Mock from urllib.parse import quote @@ -325,7 +326,7 @@ class UserDirectoryTestCase(unittest.HomeserverTestCase): r.add((i["user_id"], i["other_user_id"], i["room_id"])) return r - def get_users_in_public_rooms(self): + def get_users_in_public_rooms(self) -> List[Tuple[str, str]]: r = self.get_success( self.store.db_pool.simple_select_list( "users_in_public_rooms", None, ("user_id", "room_id") @@ -336,7 +337,7 @@ class UserDirectoryTestCase(unittest.HomeserverTestCase): retval.append((i["user_id"], i["room_id"])) return retval - def get_users_who_share_private_rooms(self): + def get_users_who_share_private_rooms(self) -> List[Tuple[str, str, str]]: return self.get_success( self.store.db_pool.simple_select_list( "users_who_share_private_rooms", |