mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Fix flaky shadow-ban tests. (#8152)
This commit is contained in:
parent
3f49f74610
commit
3f8f96be00
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
|
import json
|
||||||
from urllib import parse as urlparse
|
from urllib import parse as urlparse
|
||||||
|
|
||||||
from mock import Mock
|
from mock import Mock, patch
|
||||||
|
|
||||||
import synapse.rest.admin
|
import synapse.rest.admin
|
||||||
from synapse.api.constants import EventContentFields, EventTypes, Membership
|
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)
|
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):
|
class ShadowBannedTestCase(unittest.HomeserverTestCase):
|
||||||
servlets = [
|
servlets = [
|
||||||
synapse.rest.admin.register_servlets_for_client_rest_resource,
|
synapse.rest.admin.register_servlets_for_client_rest_resource,
|
||||||
|
Loading…
Reference in New Issue
Block a user