diff options
author | Richard van der Hoff <richard@matrix.org> | 2019-10-24 11:13:48 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2019-10-24 11:13:48 +0100 |
commit | 04ec48283ee69b20ff04d18a548ba2e04afd116f (patch) | |
tree | 197c25335435a8e62b945313ed4c5c53bd2ead4f | |
parent | Address review comments and final cleanups (diff) | |
download | synapse-neilj/disable-mau-alerting-for-small-instances.tar.xz |
fix test failures github/neilj/disable-mau-alerting-for-small-instances neilj/disable-mau-alerting-for-small-instances
-rw-r--r-- | synapse/server_notices/resource_limits_server_notices.py | 4 | ||||
-rw-r--r-- | tests/server_notices/test_resource_limits_server_notices.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/synapse/server_notices/resource_limits_server_notices.py b/synapse/server_notices/resource_limits_server_notices.py index 88c638add4..c0e7f475c9 100644 --- a/synapse/server_notices/resource_limits_server_notices.py +++ b/synapse/server_notices/resource_limits_server_notices.py @@ -113,10 +113,10 @@ class ResourceLimitsServerNotices(object): self._remove_limit_block_notification(user_id, ref_events) return - if currently_blocked and not limit_type: + if currently_blocked and not limit_msg: # Room is notifying of a block, when it ought not to be. yield self._remove_limit_block_notification(user_id, ref_events) - elif not currently_blocked and limit_type: + elif not currently_blocked and limit_msg: # Room is not notifying of a block, when it ought to be. yield self._apply_limit_block_notification( user_id, limit_msg, limit_type diff --git a/tests/server_notices/test_resource_limits_server_notices.py b/tests/server_notices/test_resource_limits_server_notices.py index b5085944e5..eb540e34f6 100644 --- a/tests/server_notices/test_resource_limits_server_notices.py +++ b/tests/server_notices/test_resource_limits_server_notices.py @@ -133,7 +133,7 @@ class TestResourceLimitsServerNotices(unittest.HomeserverTestCase): self.get_success(self._rlsn.maybe_send_server_notice_to_user(self.user_id)) # Would be better to check contents, but 2 calls == set blocking event - self.assertTrue(self._send_notice.call_count == 2) + self.assertEqual(self._send_notice.call_count, 2) def test_maybe_send_server_notice_to_user_add_blocked_notice_noop(self): """ |