summary refs log tree commit diff
path: root/tests/handlers
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-08-18 12:59:56 +0100
committerGitHub <noreply@github.com>2016-08-18 12:59:56 +0100
commit6762a7268c049d254a2543bcbf20236735a31880 (patch)
treecf6dc7f8655a619490795377eee2d8e5a32861aa /tests/handlers
parentMissed a s/federation reader/media repository/ in a log message (diff)
parentMake AppserviceHandler stream events from database (diff)
downloadsynapse-6762a7268c049d254a2543bcbf20236735a31880.tar.xz
Merge pull request #1025 from matrix-org/erikj/appservice_stream
Make AppserviceHandler stream events from database
Diffstat (limited to 'tests/handlers')
-rw-r--r--tests/handlers/test_appservice.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/handlers/test_appservice.py b/tests/handlers/test_appservice.py
index 9c1e5cc67c..7fe88172c0 100644
--- a/tests/handlers/test_appservice.py
+++ b/tests/handlers/test_appservice.py
@@ -53,8 +53,9 @@ class AppServiceHandlerTestCase(unittest.TestCase):
             type="m.room.message",
             room_id="!foo:bar"
         )
+        self.mock_store.get_new_events_for_appservice.return_value = (0, [event])
         self.mock_as_api.push = Mock()
-        yield self.handler.notify_interested_services(event)
+        yield self.handler.notify_interested_services(0)
         self.mock_scheduler.submit_event_for_as.assert_called_once_with(
             interested_service, event
         )
@@ -74,7 +75,8 @@ class AppServiceHandlerTestCase(unittest.TestCase):
         )
         self.mock_as_api.push = Mock()
         self.mock_as_api.query_user = Mock()
-        yield self.handler.notify_interested_services(event)
+        self.mock_store.get_new_events_for_appservice.return_value = (0, [event])
+        yield self.handler.notify_interested_services(0)
         self.mock_as_api.query_user.assert_called_once_with(
             services[0], user_id
         )
@@ -96,7 +98,8 @@ class AppServiceHandlerTestCase(unittest.TestCase):
         )
         self.mock_as_api.push = Mock()
         self.mock_as_api.query_user = Mock()
-        yield self.handler.notify_interested_services(event)
+        self.mock_store.get_new_events_for_appservice.return_value = (0, [event])
+        yield self.handler.notify_interested_services(0)
         self.assertFalse(
             self.mock_as_api.query_user.called,
             "query_user called when it shouldn't have been."