1
0

fix test failures

This commit is contained in:
Richard van der Hoff
2019-10-24 11:13:48 +01:00
parent 1b1b2a26a1
commit 04ec48283e
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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):
"""