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 | |
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')
-rw-r--r-- | tests/rest/test_presence.py | 20 | ||||
-rw-r--r-- | tests/rest/test_rooms.py | 12 |
2 files changed, 18 insertions, 14 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) diff --git a/tests/rest/test_rooms.py b/tests/rest/test_rooms.py index b432cf254e..cdaf948a3b 100644 --- a/tests/rest/test_rooms.py +++ b/tests/rest/test_rooms.py @@ -51,7 +51,7 @@ class RoomPermissionsTestCase(RestTestCase): persistence_service.get_latest_pdus_in_context.return_value = [] hs = HomeServer( - "test", + "red", db_pool=None, http_client=None, datastore=MemoryDataStore(), @@ -398,7 +398,7 @@ class RoomsMemberListTestCase(RestTestCase): persistence_service.get_latest_pdus_in_context.return_value = [] hs = HomeServer( - "test", + "red", db_pool=None, http_client=None, datastore=MemoryDataStore(), @@ -476,7 +476,7 @@ class RoomsCreateTestCase(RestTestCase): persistence_service.get_latest_pdus_in_context.return_value = [] hs = HomeServer( - "test", + "red", db_pool=None, http_client=None, datastore=MemoryDataStore(), @@ -566,7 +566,7 @@ class RoomTopicTestCase(RestTestCase): persistence_service.get_latest_pdus_in_context.return_value = [] hs = HomeServer( - "test", + "red", db_pool=None, http_client=None, datastore=MemoryDataStore(), @@ -669,7 +669,7 @@ class RoomMemberStateTestCase(RestTestCase): persistence_service.get_latest_pdus_in_context.return_value = [] hs = HomeServer( - "test", + "red", db_pool=None, http_client=None, datastore=MemoryDataStore(), @@ -794,7 +794,7 @@ class RoomMessagesTestCase(RestTestCase): persistence_service.get_latest_pdus_in_context.return_value = [] hs = HomeServer( - "test", + "red", db_pool=None, http_client=None, datastore=MemoryDataStore(), |