mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-13 23:53:47 +01:00
Fix flaky shadow-ban tests. (#8152)
This commit is contained in:
parent
3f49f74610
commit
3f8f96be00
2 changed files with 4 additions and 1 deletions
1
changelog.d/8152.feature
Normal file
1
changelog.d/8152.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Add support for shadow-banning users (ignoring any message send requests).
|
|
@ -21,7 +21,7 @@
|
|||
import json
|
||||
from urllib import parse as urlparse
|
||||
|
||||
from mock import Mock
|
||||
from mock import Mock, patch
|
||||
|
||||
import synapse.rest.admin
|
||||
from synapse.api.constants import EventContentFields, EventTypes, Membership
|
||||
|
@ -1976,6 +1976,8 @@ class RoomCanonicalAliasTestCase(unittest.HomeserverTestCase):
|
|||
self._set_canonical_alias({"alt_aliases": ["@unknown:test"]}, expected_code=400)
|
||||
|
||||
|
||||
# To avoid the tests timing out don't add a delay to "annoy the requester".
|
||||
@patch("random.randint", new=lambda a, b: 0)
|
||||
class ShadowBannedTestCase(unittest.HomeserverTestCase):
|
||||
servlets = [
|
||||
synapse.rest.admin.register_servlets_for_client_rest_resource,
|
||||
|
|
Loading…
Reference in a new issue