summary refs log tree commit diff
path: root/tests/rest
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-10-20 17:42:00 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2020-10-20 17:42:00 +0100
commited944cb079cf9a8685f6619265969695fea51992 (patch)
tree4c597f79f84046aeadecfe37033702a0d0213199 /tests/rest
parentMerge commit 'b71d4a094' into anoa/dinsic_release_1_21_x (diff)
parentConvert stats and related calls to async/await (#8192) (diff)
downloadsynapse-ed944cb079cf9a8685f6619265969695fea51992.tar.xz
Merge commit 'b49a5b930' into anoa/dinsic_release_1_21_x
* commit 'b49a5b930':
  Convert stats and related calls to async/await (#8192)
Diffstat (limited to 'tests/rest')
-rw-r--r--tests/rest/admin/test_user.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/rest/admin/test_user.py b/tests/rest/admin/test_user.py

index 17d0aae2e9..160c630235 100644 --- a/tests/rest/admin/test_user.py +++ b/tests/rest/admin/test_user.py
@@ -20,8 +20,6 @@ import urllib.parse from mock import Mock -from twisted.internet import defer - import synapse.rest.admin from synapse.api.constants import UserTypes from synapse.api.errors import HttpResponseException, ResourceLimitError @@ -29,6 +27,7 @@ from synapse.rest.client.v1 import login from synapse.rest.client.v2_alpha import sync from tests import unittest +from tests.test_utils import make_awaitable from tests.unittest import override_config @@ -338,7 +337,7 @@ class UserRegisterTestCase(unittest.HomeserverTestCase): # Set monthly active users to the limit store.get_monthly_active_count = Mock( - return_value=defer.succeed(self.hs.config.max_mau_value) + side_effect=lambda: make_awaitable(self.hs.config.max_mau_value) ) # Check that the blocking of monthly active users is working as expected # The registration of a new user fails due to the limit @@ -592,7 +591,7 @@ class UserRestTestCase(unittest.HomeserverTestCase): # Set monthly active users to the limit self.store.get_monthly_active_count = Mock( - return_value=defer.succeed(self.hs.config.max_mau_value) + side_effect=lambda: make_awaitable(self.hs.config.max_mau_value) ) # Check that the blocking of monthly active users is working as expected # The registration of a new user fails due to the limit @@ -632,7 +631,7 @@ class UserRestTestCase(unittest.HomeserverTestCase): # Set monthly active users to the limit self.store.get_monthly_active_count = Mock( - return_value=defer.succeed(self.hs.config.max_mau_value) + side_effect=lambda: make_awaitable(self.hs.config.max_mau_value) ) # Check that the blocking of monthly active users is working as expected # The registration of a new user fails due to the limit