summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-26 16:36:24 +0100
committerErik Johnston <erik@matrix.org>2014-09-26 16:36:24 +0100
commit0fdf3088743b25e9fcc39b7b3b4c7f6e8332e26c (patch)
treea5433fb7afa8fb62c65f5a4395c7ed7b1f0a9af4 /tests
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-0fdf3088743b25e9fcc39b7b3b4c7f6e8332e26c.tar.xz
Track the IP users connect with. Add an admin column to users table.
Diffstat (limited to '')
-rw-r--r--tests/rest/test_presence.py6
-rw-r--r--tests/rest/test_profile.py4
-rw-r--r--tests/utils.py3
3 files changed, 10 insertions, 3 deletions
diff --git a/tests/rest/test_presence.py b/tests/rest/test_presence.py
index ea3478ac5d..1b3e6759c2 100644
--- a/tests/rest/test_presence.py
+++ b/tests/rest/test_presence.py
@@ -51,10 +51,12 @@ class PresenceStateTestCase(unittest.TestCase):
             datastore=Mock(spec=[
                 "get_presence_state",
                 "set_presence_state",
+                "insert_client_ip",
             ]),
             http_client=None,
             resource_for_client=self.mock_resource,
             resource_for_federation=self.mock_resource,
+            config=Mock(),
         )
         hs.handlers = JustPresenceHandlers(hs)
 
@@ -131,10 +133,12 @@ class PresenceListTestCase(unittest.TestCase):
                 "set_presence_list_accepted",
                 "del_presence_list",
                 "get_presence_list",
+                "insert_client_ip",
             ]),
             http_client=None,
             resource_for_client=self.mock_resource,
-            resource_for_federation=self.mock_resource
+            resource_for_federation=self.mock_resource,
+            config=Mock(),
         )
         hs.handlers = JustPresenceHandlers(hs)
 
diff --git a/tests/rest/test_profile.py b/tests/rest/test_profile.py
index e6e51f6dd0..b0f48e7fd8 100644
--- a/tests/rest/test_profile.py
+++ b/tests/rest/test_profile.py
@@ -50,10 +50,10 @@ class ProfileTestCase(unittest.TestCase):
             datastore=None,
         )
 
-        def _get_user_by_token(token=None):
+        def _get_user_by_req(request=None):
             return hs.parse_userid(myid)
 
-        hs.get_auth().get_user_by_token = _get_user_by_token
+        hs.get_auth().get_user_by_req = _get_user_by_req
 
         hs.get_handlers().profile_handler = self.mock_handler
 
diff --git a/tests/utils.py b/tests/utils.py
index bb8e9964dd..ae97621147 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -264,6 +264,9 @@ class MemoryDataStore(object):
     def get_ops_levels(self, room_id):
         return defer.succeed((5, 5, 5))
 
+    def insert_client_ip(self, user, access_token, ip_addr):
+        return defer.succeed(None)
+
 
 def _format_call(args, kwargs):
     return ", ".join(