diff options
author | Hubert Chathi <hubert@uhoreg.ca> | 2020-09-03 16:38:20 -0400 |
---|---|---|
committer | Hubert Chathi <hubert@uhoreg.ca> | 2020-09-03 16:38:20 -0400 |
commit | afd9aa673a2aa018de19d50d6b44e0fcfc85230f (patch) | |
tree | 10327f31b0e0022af88e9a05b3a9f19c454d408f /tests/unittest.py | |
parent | add support for fallback keys (diff) | |
parent | 1.19.1 (diff) | |
download | synapse-afd9aa673a2aa018de19d50d6b44e0fcfc85230f.tar.xz |
Merge remote-tracking branch 'origin/master' into uhoreg/dehydration_release
Diffstat (limited to 'tests/unittest.py')
-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 |