diff --git a/tests/rest/test_presence.py b/tests/rest/test_presence.py
index ea3478ac5d..20fd179003 100644
--- a/tests/rest/test_presence.py
+++ b/tests/rest/test_presence.py
@@ -20,7 +20,7 @@ from twisted.internet import defer
from mock import Mock
-from ..utils import MockHttpResource
+from ..utils import MockHttpResource, MockKey
from synapse.api.constants import PresenceState
from synapse.handlers.presence import PresenceHandler
@@ -45,7 +45,8 @@ class PresenceStateTestCase(unittest.TestCase):
def setUp(self):
self.mock_resource = MockHttpResource(prefix=PATH_PREFIX)
-
+ self.mock_config = Mock()
+ self.mock_config.signing_key = [MockKey()]
hs = HomeServer("test",
db_pool=None,
datastore=Mock(spec=[
@@ -55,6 +56,7 @@ class PresenceStateTestCase(unittest.TestCase):
http_client=None,
resource_for_client=self.mock_resource,
resource_for_federation=self.mock_resource,
+ config=self.mock_config,
)
hs.handlers = JustPresenceHandlers(hs)
@@ -119,6 +121,8 @@ class PresenceListTestCase(unittest.TestCase):
def setUp(self):
self.mock_resource = MockHttpResource(prefix=PATH_PREFIX)
+ self.mock_config = Mock()
+ self.mock_config.signing_key = [MockKey()]
hs = HomeServer("test",
db_pool=None,
@@ -134,7 +138,8 @@ class PresenceListTestCase(unittest.TestCase):
]),
http_client=None,
resource_for_client=self.mock_resource,
- resource_for_federation=self.mock_resource
+ resource_for_federation=self.mock_resource,
+ config=self.mock_config,
)
hs.handlers = JustPresenceHandlers(hs)
@@ -225,6 +230,9 @@ class PresenceEventStreamTestCase(unittest.TestCase):
def setUp(self):
self.mock_resource = MockHttpResource(prefix=PATH_PREFIX)
+ self.mock_config = Mock()
+ self.mock_config.signing_key = [MockKey()]
+
# HIDEOUS HACKERY
# TODO(paul): This should be injected in via the HomeServer DI system
from synapse.streams.events import (
@@ -255,6 +263,7 @@ class PresenceEventStreamTestCase(unittest.TestCase):
"cancel_call_later",
"time_msec",
]),
+ config=self.mock_config,
)
hs.get_clock().time_msec.return_value = 1000000
|