diff options
author | Neil Johnson <neil@matrix.org> | 2018-08-17 12:42:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-17 12:42:59 +0000 |
commit | a2d872e7b3770c454569d838bf1bb92115d9f32a (patch) | |
tree | 34c1b42c256987be5e0b56139a3da75d1f69ae8c /tests | |
parent | Merge pull request #3712 from matrix-org/travis/register-admin-docs (diff) | |
parent | remove errant yield (diff) | |
download | synapse-a2d872e7b3770c454569d838bf1bb92115d9f32a.tar.xz |
Merge pull request #3708 from matrix-org/neilj/resource_Limit_block_event_creation
Neilj/resource limit block event creation
Diffstat (limited to 'tests')
-rw-r--r-- | tests/storage/test_monthly_active_users.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/storage/test_monthly_active_users.py b/tests/storage/test_monthly_active_users.py index 511acbde9b..f2ed866ae7 100644 --- a/tests/storage/test_monthly_active_users.py +++ b/tests/storage/test_monthly_active_users.py @@ -75,6 +75,19 @@ class MonthlyActiveUsersTestCase(tests.unittest.TestCase): active_count = yield self.store.get_monthly_active_count() self.assertEquals(active_count, user_num) + # Test that regalar users are removed from the db + ru_count = 2 + yield self.store.upsert_monthly_active_user("@ru1:server") + yield self.store.upsert_monthly_active_user("@ru2:server") + active_count = yield self.store.get_monthly_active_count() + + self.assertEqual(active_count, user_num + ru_count) + self.hs.config.max_mau_value = user_num + yield self.store.reap_monthly_active_users() + + active_count = yield self.store.get_monthly_active_count() + self.assertEquals(active_count, user_num) + @defer.inlineCallbacks def test_can_insert_and_count_mau(self): count = yield self.store.get_monthly_active_count() |