diff options
author | reivilibre <oliverw@matrix.org> | 2021-11-01 15:45:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-01 15:45:56 +0000 |
commit | 69ab3dddbc1595ee64c428df7a7f3c861a84b5b0 (patch) | |
tree | d765576c98cd2620dfbc87d4c6597c4a34ff5262 /tests | |
parent | Remove deprecated delete room admin API (#11213) (diff) | |
download | synapse-69ab3dddbc1595ee64c428df7a7f3c861a84b5b0.tar.xz |
Make `check_event_allowed` module API callback not fail open (accept events) when an exception is raised (#11033)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/rest/client/test_third_party_rules.py | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/tests/rest/client/test_third_party_rules.py b/tests/rest/client/test_third_party_rules.py index 1c42c46630..4e71b6ec12 100644 --- a/tests/rest/client/test_third_party_rules.py +++ b/tests/rest/client/test_third_party_rules.py @@ -216,19 +216,9 @@ class ThirdPartyRulesTestCase(unittest.FederatingHomeserverTestCase): {"x": "x"}, access_token=self.tok, ) - # check_event_allowed has some error handling, so it shouldn't 500 just because a - # module did something bad. - self.assertEqual(channel.code, 200, channel.result) - event_id = channel.json_body["event_id"] - - channel = self.make_request( - "GET", - "/_matrix/client/r0/rooms/%s/event/%s" % (self.room_id, event_id), - access_token=self.tok, - ) - self.assertEqual(channel.code, 200, channel.result) - ev = channel.json_body - self.assertEqual(ev["content"]["x"], "x") + # Because check_event_allowed raises an exception, it leads to a + # 500 Internal Server Error + self.assertEqual(channel.code, 500, channel.result) def test_modify_event(self): """The module can return a modified version of the event""" |