summary refs log tree commit diff
path: root/tests/rest/test_presence.py
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2014-08-13 19:18:55 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-08-13 19:19:15 +0100
commitd05aa651f80b604428c003a13a03c4f6f61c317d (patch)
tree655502cdd01fe89c0ab56a3b0d27cc9faf95b2e9 /tests/rest/test_presence.py
parentAllow advancing the MockClock's time (diff)
downloadsynapse-d05aa651f80b604428c003a13a03c4f6f61c317d.tar.xz
An initial hack at storing presence state-change mtimes in database and presenting age durations to clients/federation events
Diffstat (limited to '')
-rw-r--r--tests/rest/test_presence.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/rest/test_presence.py b/tests/rest/test_presence.py
index 7c54e067c9..f013abbee4 100644
--- a/tests/rest/test_presence.py
+++ b/tests/rest/test_presence.py
@@ -234,7 +234,11 @@ class PresenceEventStreamTestCase(unittest.TestCase):
         # I'll already get my own presence state change
         self.assertEquals({"start": "0", "end": "1", "chunk": [
             {"type": "m.presence",
-             "content": {"user_id": "@apple:test", "state": ONLINE}},
+             "content": {
+                 "user_id": "@apple:test",
+                 "state": ONLINE,
+                 "mtime_age": 0,
+            }},
         ]}, response)
 
         self.mock_datastore.set_presence_state.return_value = defer.succeed(
@@ -251,5 +255,9 @@ class PresenceEventStreamTestCase(unittest.TestCase):
         self.assertEquals(200, code)
         self.assertEquals({"start": "1", "end": "2", "chunk": [
             {"type": "m.presence",
-             "content": {"user_id": "@banana:test", "state": ONLINE}},
+             "content": {
+                 "user_id": "@banana:test",
+                 "state": ONLINE,
+                 "mtime_age": 0,
+            }},
         ]}, response)