summary refs log tree commit diff
path: root/tests/rest/test_presence.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-29 15:59:05 +0100
committerErik Johnston <erik@matrix.org>2014-09-29 15:59:05 +0100
commitf1bdf40dda5eaba622103b64e749b539e5ce6bf1 (patch)
treea2a09ff016223528aafa4ce50c9b12698e44c6b1 /tests/rest/test_presence.py
parentNo longer need the Freenode verification key file (diff)
parentUnbreak tests after changing storage API (diff)
downloadsynapse-f1bdf40dda5eaba622103b64e749b539e5ce6bf1.tar.xz
Merge branch 'whois' of github.com:matrix-org/synapse into develop
Diffstat (limited to 'tests/rest/test_presence.py')
-rw-r--r--tests/rest/test_presence.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/rest/test_presence.py b/tests/rest/test_presence.py
index ea3478ac5d..e2dc3dec81 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)
 
@@ -65,7 +67,11 @@ class PresenceStateTestCase(unittest.TestCase):
         self.datastore.get_presence_list = get_presence_list
 
         def _get_user_by_token(token=None):
-            return hs.parse_userid(myid)
+            return {
+                "user": hs.parse_userid(myid),
+                "admin": False,
+                "device_id": None,
+            }
 
         hs.get_auth().get_user_by_token = _get_user_by_token
 
@@ -131,10 +137,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)
 
@@ -147,7 +155,11 @@ class PresenceListTestCase(unittest.TestCase):
         self.datastore.has_presence_state = has_presence_state
 
         def _get_user_by_token(token=None):
-            return hs.parse_userid(myid)
+            return {
+                "user": hs.parse_userid(myid),
+                "admin": False,
+                "device_id": None,
+            }
 
         room_member_handler = hs.handlers.room_member_handler = Mock(
             spec=[