diff options
author | Neil Johnson <neil@matrix.org> | 2018-08-17 12:44:26 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-17 12:44:26 +0000 |
commit | 69c49d3fa3dc91ff6cbbadb52dc14e60cb063ecc (patch) | |
tree | a2a6e5b2b873ffb119d6124e4b9feae56bc22bbd /tests/storage | |
parent | add new error type ResourceLimit (diff) | |
parent | Merge pull request #3708 from matrix-org/neilj/resource_Limit_block_event_cre... (diff) | |
download | synapse-69c49d3fa3dc91ff6cbbadb52dc14e60cb063ecc.tar.xz |
Merge branch 'develop' into neilj/limit_exceeded_error
Diffstat (limited to 'tests/storage')
-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() |