summary refs log tree commit diff
path: root/tests/storage
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-08-03 17:55:50 +0100
committerNeil Johnson <neil@matrix.org>2018-08-03 17:55:50 +0100
commite10830e9765eb3897da5af6ffb4809badb8e3009 (patch)
treece610191673cdbd0965f9e2fb0aa55bd7d09271b /tests/storage
parentfix (lots of) py3 test failures (diff)
downloadsynapse-e10830e9765eb3897da5af6ffb4809badb8e3009.tar.xz
wip commit - tests failing
Diffstat (limited to 'tests/storage')
-rw-r--r--tests/storage/test_client_ips.py12
-rw-r--r--tests/storage/test_monthly_active_users.py14
2 files changed, 13 insertions, 13 deletions
diff --git a/tests/storage/test_client_ips.py b/tests/storage/test_client_ips.py
index e1552510cc..7a58c6eb24 100644
--- a/tests/storage/test_client_ips.py
+++ b/tests/storage/test_client_ips.py
@@ -64,7 +64,7 @@ class ClientIpStoreTestCase(tests.unittest.TestCase):
         yield self.store.insert_client_ip(
             user_id, "access_token", "ip", "user_agent", "device_id",
         )
-        active = yield self.store.is_user_monthly_active(user_id)
+        active = yield self.store._user_last_seen_monthly_active(user_id)
         self.assertFalse(active)
 
     @defer.inlineCallbacks
@@ -80,7 +80,7 @@ class ClientIpStoreTestCase(tests.unittest.TestCase):
         yield self.store.insert_client_ip(
             user_id, "access_token", "ip", "user_agent", "device_id",
         )
-        active = yield self.store.is_user_monthly_active(user_id)
+        active = yield self.store._user_last_seen_monthly_active(user_id)
         self.assertFalse(active)
 
     @defer.inlineCallbacks
@@ -88,13 +88,13 @@ class ClientIpStoreTestCase(tests.unittest.TestCase):
         self.hs.config.limit_usage_by_mau = True
         self.hs.config.max_mau_value = 50
         user_id = "@user:server"
-        active = yield self.store.is_user_monthly_active(user_id)
+        active = yield self.store._user_last_seen_monthly_active(user_id)
         self.assertFalse(active)
 
         yield self.store.insert_client_ip(
             user_id, "access_token", "ip", "user_agent", "device_id",
         )
-        active = yield self.store.is_user_monthly_active(user_id)
+        active = yield self.store._user_last_seen_monthly_active(user_id)
         self.assertTrue(active)
 
     @defer.inlineCallbacks
@@ -103,7 +103,7 @@ class ClientIpStoreTestCase(tests.unittest.TestCase):
         self.hs.config.max_mau_value = 50
         user_id = "@user:server"
 
-        active = yield self.store.is_user_monthly_active(user_id)
+        active = yield self.store._user_last_seen_monthly_active(user_id)
         self.assertFalse(active)
 
         yield self.store.insert_client_ip(
@@ -112,5 +112,5 @@ class ClientIpStoreTestCase(tests.unittest.TestCase):
         yield self.store.insert_client_ip(
             user_id, "access_token", "ip", "user_agent", "device_id",
         )
-        active = yield self.store.is_user_monthly_active(user_id)
+        active = yield self.store._user_last_seen_monthly_active(user_id)
         self.assertTrue(active)
diff --git a/tests/storage/test_monthly_active_users.py b/tests/storage/test_monthly_active_users.py
index c32109ecc5..0bfd24a7fb 100644
--- a/tests/storage/test_monthly_active_users.py
+++ b/tests/storage/test_monthly_active_users.py
@@ -40,18 +40,18 @@ class MonthlyActiveUsersTestCase(tests.unittest.TestCase):
         self.assertEqual(1, count)
 
     @defer.inlineCallbacks
-    def test_is_user_monthly_active(self):
+    def test__user_last_seen_monthly_active(self):
         user_id1 = "@user1:server"
         user_id2 = "@user2:server"
         user_id3 = "@user3:server"
-        result = yield self.store.is_user_monthly_active(user_id1)
-        self.assertFalse(result)
+        result = yield self.store._user_last_seen_monthly_active(user_id1)
+        self.assertFalse(result == 0)
         yield self.store.upsert_monthly_active_user(user_id1)
         yield self.store.upsert_monthly_active_user(user_id2)
-        result = yield self.store.is_user_monthly_active(user_id1)
-        self.assertTrue(result)
-        result = yield self.store.is_user_monthly_active(user_id3)
-        self.assertFalse(result)
+        result = yield self.store._user_last_seen_monthly_active(user_id1)
+        self.assertTrue(result > 0)
+        result = yield self.store._user_last_seen_monthly_active(user_id3)
+        self.assertFalse(result == 0)
 
     @defer.inlineCallbacks
     def test_reap_monthly_active_users(self):