diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-01 15:38:37 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-01 15:39:50 +0100 |
commit | 468d94c92066ddb76db7f38771e283c152cabb7d (patch) | |
tree | b857c837ce5369b726ed138539815e2379247e6e /tests/handlers/test_presencelike.py | |
parent | Fixed presence change that occurs -Xs ago (diff) | |
download | synapse-468d94c92066ddb76db7f38771e283c152cabb7d.tar.xz |
Rename API-visible 'mtime' presence field to 'last_active'; slightly different semantics
Diffstat (limited to 'tests/handlers/test_presencelike.py')
-rw-r--r-- | tests/handlers/test_presencelike.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/handlers/test_presencelike.py b/tests/handlers/test_presencelike.py index 2402bed8d5..38cc34350b 100644 --- a/tests/handlers/test_presencelike.py +++ b/tests/handlers/test_presencelike.py @@ -166,7 +166,11 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase): # TODO(paul): Gut-wrenching from synapse.handlers.presence import UserPresenceCache self.handlers.presence_handler._user_cachemap[self.u_apple] = ( - UserPresenceCache()) + UserPresenceCache() + ) + self.handlers.presence_handler._user_cachemap[self.u_apple].update( + {"presence": OFFLINE}, serial=0 + ) apple_set = self.handlers.presence_handler._local_pushmap.setdefault( "apple", set()) apple_set.add(self.u_banana) @@ -184,7 +188,7 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase): {"observed_user": self.u_banana, "presence": ONLINE, "state": ONLINE, - "mtime_age": 0, + "last_active_ago": 0, "displayname": "Frank", "avatar_url": "http://foo"}, {"observed_user": self.u_clementine, @@ -202,7 +206,7 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase): statuscache = self.mock_update_client.call_args[1]["statuscache"] self.assertEquals({ "presence": ONLINE, - "mtime": 1000000, # MockClock + "last_active": 1000000, # MockClock "displayname": "Frank", "avatar_url": "http://foo", }, statuscache.state) @@ -225,7 +229,7 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase): statuscache = self.mock_update_client.call_args[1]["statuscache"] self.assertEquals({ "presence": ONLINE, - "mtime": 1000000, # MockClock + "last_active": 1000000, # MockClock "displayname": "I am an Apple", "avatar_url": "http://foo", }, statuscache.state) @@ -243,7 +247,11 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase): # TODO(paul): Gut-wrenching from synapse.handlers.presence import UserPresenceCache self.handlers.presence_handler._user_cachemap[self.u_apple] = ( - UserPresenceCache()) + UserPresenceCache() + ) + self.handlers.presence_handler._user_cachemap[self.u_apple].update( + {"presence": OFFLINE}, serial=0 + ) apple_set = self.handlers.presence_handler._remote_sendmap.setdefault( "apple", set()) apple_set.add(self.u_potato.domain) @@ -259,7 +267,7 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase): {"user_id": "@apple:test", "presence": "online", "state": "online", - "mtime_age": 0, + "last_active_ago": 0, "displayname": "Frank", "avatar_url": "http://foo"}, ], |