diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-08-06 08:30:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-06 08:30:06 -0400 |
commit | d4a7829b12197faf52eb487c443ee09acafeb37e (patch) | |
tree | cab5f15a7532596153f61b47aafcf4cb4a4b7d45 /tests/unittest.py | |
parent | Convert run_as_background_process inner function to async. (#8032) (diff) | |
download | synapse-d4a7829b12197faf52eb487c443ee09acafeb37e.tar.xz |
Convert synapse.api to async/await (#8031)
Diffstat (limited to '')
-rw-r--r-- | tests/unittest.py | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/tests/unittest.py b/tests/unittest.py index 2152c693f2..d0bba3ddef 100644 --- a/tests/unittest.py +++ b/tests/unittest.py @@ -241,20 +241,16 @@ class HomeserverTestCase(TestCase): if hasattr(self, "user_id"): if self.hijack_auth: - def get_user_by_access_token(token=None, allow_guest=False): - return succeed( - { - "user": UserID.from_string(self.helper.auth_user_id), - "token_id": 1, - "is_guest": False, - } - ) - - def get_user_by_req(request, allow_guest=False, rights="access"): - return succeed( - create_requester( - UserID.from_string(self.helper.auth_user_id), 1, False, None - ) + async def get_user_by_access_token(token=None, allow_guest=False): + return { + "user": UserID.from_string(self.helper.auth_user_id), + "token_id": 1, + "is_guest": False, + } + + async def get_user_by_req(request, allow_guest=False, rights="access"): + return create_requester( + UserID.from_string(self.helper.auth_user_id), 1, False, None ) self.hs.get_auth().get_user_by_req = get_user_by_req |