summary refs log tree commit diff
path: root/tests/rest/client/v1
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2015-04-15 23:32:11 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2015-04-15 23:32:11 +0100
commit04c7f3576ec586ec16aa232794d01035390f8611 (patch)
treee12f85132f8b18b6fa08780d389a94f0a35f2d5a /tests/rest/client/v1
parentHave TypingNotificationEventSource.get_new_events_for_user() return a deferre... (diff)
downloadsynapse-04c7f3576ec586ec16aa232794d01035390f8611.tar.xz
Various minor fixes to unit-test structure around typing notifications
Diffstat (limited to 'tests/rest/client/v1')
-rw-r--r--tests/rest/client/v1/test_typing.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/rest/client/v1/test_typing.py b/tests/rest/client/v1/test_typing.py
index d04e5abda4..7b3bd87439 100644
--- a/tests/rest/client/v1/test_typing.py
+++ b/tests/rest/client/v1/test_typing.py
@@ -34,6 +34,8 @@ class RoomTypingTestCase(RestTestCase):
     """ Tests /rooms/$room_id/typing/$user_id REST API. """
     user_id = "@sid:red"
 
+    user = UserID.from_string(user_id)
+
     @defer.inlineCallbacks
     def setUp(self):
         self.clock = MockClock()
@@ -75,7 +77,7 @@ class RoomTypingTestCase(RestTestCase):
 
         def get_room_members(room_id):
             if room_id == self.room_id:
-                return defer.succeed([UserID.from_string(self.user_id)])
+                return defer.succeed([self.user])
             else:
                 return defer.succeed([])
 
@@ -115,7 +117,7 @@ class RoomTypingTestCase(RestTestCase):
         self.assertEquals(200, code)
 
         self.assertEquals(self.event_source.get_current_key(), 1)
-        events = yield self.event_source.get_new_events_for_user(self.user_id, 0, None)
+        events = yield self.event_source.get_new_events_for_user(self.user, 0, None)
         self.assertEquals(
             events[0],
             [