summary refs log tree commit diff
path: root/tests/storage/test_client_ips.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/storage/test_client_ips.py')
-rw-r--r--tests/storage/test_client_ips.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/storage/test_client_ips.py b/tests/storage/test_client_ips.py
index 6d2bb3058e..c2e88bdbaf 100644
--- a/tests/storage/test_client_ips.py
+++ b/tests/storage/test_client_ips.py
@@ -28,7 +28,7 @@ class ClientIpStoreTestCase(tests.unittest.TestCase):
 
     @defer.inlineCallbacks
     def setUp(self):
-        self.hs = yield tests.utils.setup_test_homeserver()
+        self.hs = yield tests.utils.setup_test_homeserver(self.addCleanup)
         self.store = self.hs.get_datastore()
         self.clock = self.hs.get_clock()
 
@@ -37,8 +37,7 @@ class ClientIpStoreTestCase(tests.unittest.TestCase):
         self.clock.now = 12345678
         user_id = "@user:id"
         yield self.store.insert_client_ip(
-            user_id,
-            "access_token", "ip", "user_agent", "device_id",
+            user_id, "access_token", "ip", "user_agent", "device_id"
         )
 
         result = yield self.store.get_last_client_ip_by_device(user_id, "device_id")
@@ -53,7 +52,7 @@ class ClientIpStoreTestCase(tests.unittest.TestCase):
                 "user_agent": "user_agent",
                 "last_seen": 12345678000,
             },
-            r
+            r,
         )
 
     @defer.inlineCallbacks
@@ -62,7 +61,7 @@ class ClientIpStoreTestCase(tests.unittest.TestCase):
         self.hs.config.max_mau_value = 50
         user_id = "@user:server"
         yield self.store.insert_client_ip(
-            user_id, "access_token", "ip", "user_agent", "device_id",
+            user_id, "access_token", "ip", "user_agent", "device_id"
         )
         active = yield self.store.user_last_seen_monthly_active(user_id)
         self.assertFalse(active)
@@ -78,7 +77,7 @@ class ClientIpStoreTestCase(tests.unittest.TestCase):
             return_value=defer.succeed(lots_of_users)
         )
         yield self.store.insert_client_ip(
-            user_id, "access_token", "ip", "user_agent", "device_id",
+            user_id, "access_token", "ip", "user_agent", "device_id"
         )
         active = yield self.store.user_last_seen_monthly_active(user_id)
         self.assertFalse(active)
@@ -92,7 +91,7 @@ class ClientIpStoreTestCase(tests.unittest.TestCase):
         self.assertFalse(active)
 
         yield self.store.insert_client_ip(
-            user_id, "access_token", "ip", "user_agent", "device_id",
+            user_id, "access_token", "ip", "user_agent", "device_id"
         )
         active = yield self.store.user_last_seen_monthly_active(user_id)
         self.assertTrue(active)
@@ -107,10 +106,10 @@ class ClientIpStoreTestCase(tests.unittest.TestCase):
         self.assertFalse(active)
 
         yield self.store.insert_client_ip(
-            user_id, "access_token", "ip", "user_agent", "device_id",
+            user_id, "access_token", "ip", "user_agent", "device_id"
         )
         yield self.store.insert_client_ip(
-            user_id, "access_token", "ip", "user_agent", "device_id",
+            user_id, "access_token", "ip", "user_agent", "device_id"
         )
         active = yield self.store.user_last_seen_monthly_active(user_id)
         self.assertTrue(active)