mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-15 09:21:55 -05:00
Convert synapse.api to async/await (#8031)
This commit is contained in:
parent
c36228c403
commit
d4a7829b12
22 changed files with 171 additions and 159 deletions
|
|
@ -20,6 +20,8 @@ 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
|
||||
|
|
@ -335,7 +337,9 @@ class UserRegisterTestCase(unittest.HomeserverTestCase):
|
|||
store = self.hs.get_datastore()
|
||||
|
||||
# Set monthly active users to the limit
|
||||
store.get_monthly_active_count = Mock(return_value=self.hs.config.max_mau_value)
|
||||
store.get_monthly_active_count = Mock(
|
||||
return_value=defer.succeed(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
|
||||
self.get_failure(
|
||||
|
|
@ -588,7 +592,7 @@ class UserRestTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
# Set monthly active users to the limit
|
||||
self.store.get_monthly_active_count = Mock(
|
||||
return_value=self.hs.config.max_mau_value
|
||||
return_value=defer.succeed(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
|
||||
|
|
@ -628,7 +632,7 @@ class UserRestTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
# Set monthly active users to the limit
|
||||
self.store.get_monthly_active_count = Mock(
|
||||
return_value=self.hs.config.max_mau_value
|
||||
return_value=defer.succeed(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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue