diff options
author | Erik Johnston <erik@matrix.org> | 2014-09-01 18:21:29 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-09-01 18:21:29 +0100 |
commit | 3faa2ae78c7ce2330ed7699ffe3fd08306055da9 (patch) | |
tree | e97b09a70586b58cdc9f2533dae1d071167b4b71 /tests/rest/test_presence.py | |
parent | Add beginnings of ban support. (diff) | |
parent | Follow API renaming. state -> presence. mtime_ago -> last_active_ago (diff) | |
download | synapse-3faa2ae78c7ce2330ed7699ffe3fd08306055da9.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into room_config
Diffstat (limited to 'tests/rest/test_presence.py')
-rw-r--r-- | tests/rest/test_presence.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/rest/test_presence.py b/tests/rest/test_presence.py index 61692f02c2..e2cdd80e07 100644 --- a/tests/rest/test_presence.py +++ b/tests/rest/test_presence.py @@ -98,8 +98,10 @@ class PresenceStateTestCase(unittest.TestCase): "/presence/%s/status" % (myid), None) self.assertEquals(200, code) - self.assertEquals({"state": ONLINE, "status_msg": "Available"}, - response) + self.assertEquals( + {"presence": ONLINE, "state": ONLINE, "status_msg": "Available"}, + response + ) mocked_get.assert_called_with("apple") @defer.inlineCallbacks @@ -109,7 +111,7 @@ class PresenceStateTestCase(unittest.TestCase): (code, response) = yield self.mock_resource.trigger("PUT", "/presence/%s/status" % (myid), - '{"state": "unavailable", "status_msg": "Away"}') + '{"presence": "unavailable", "status_msg": "Away"}') self.assertEquals(200, code) mocked_set.assert_called_with("apple", @@ -173,9 +175,9 @@ class PresenceListTestCase(unittest.TestCase): "/presence/list/%s" % (myid), None) self.assertEquals(200, code) - self.assertEquals( - [{"user_id": "@banana:test", "state": OFFLINE}], response - ) + self.assertEquals([ + {"user_id": "@banana:test", "presence": OFFLINE, "state": OFFLINE}, + ], response) self.datastore.get_presence_list.assert_called_with( "apple", accepted=True @@ -314,7 +316,8 @@ class PresenceEventStreamTestCase(unittest.TestCase): []) yield self.presence.set_state(self.u_banana, self.u_banana, - state={"state": ONLINE}) + state={"presence": ONLINE} + ) (code, response) = yield self.mock_resource.trigger("GET", "/events?from=0_1_0&timeout=0", None) @@ -324,8 +327,9 @@ class PresenceEventStreamTestCase(unittest.TestCase): {"type": "m.presence", "content": { "user_id": "@banana:test", + "presence": ONLINE, "state": ONLINE, "displayname": "Frank", - "mtime_age": 0, + "last_active_ago": 0, }}, ]}, response) |