diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-03 15:37:10 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-03 15:37:10 +0100 |
commit | cda31fb7553ba3d880de09a464ae3b62ea6632fc (patch) | |
tree | 3349213bfbf925a97f549887e0fd7d13c8cb68b6 /tests/rest | |
parent | Bugfix for back-pagination of presence (diff) | |
download | synapse-cda31fb7553ba3d880de09a464ae3b62ea6632fc.tar.xz |
Kill the state
... key from all the Presence messages
Diffstat (limited to 'tests/rest')
-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 df8dd74151..f2751f56d3 100644 --- a/tests/rest/test_presence.py +++ b/tests/rest/test_presence.py @@ -99,7 +99,7 @@ class PresenceStateTestCase(unittest.TestCase): self.assertEquals(200, code) self.assertEquals( - {"presence": ONLINE, "state": ONLINE, "status_msg": "Available"}, + {"presence": ONLINE, "status_msg": "Available"}, response ) mocked_get.assert_called_with("apple") @@ -115,7 +115,8 @@ class PresenceStateTestCase(unittest.TestCase): self.assertEquals(200, code) mocked_set.assert_called_with("apple", - {"state": UNAVAILABLE, "status_msg": "Away"}) + {"state": UNAVAILABLE, "status_msg": "Away"} + ) class PresenceListTestCase(unittest.TestCase): @@ -176,7 +177,7 @@ class PresenceListTestCase(unittest.TestCase): self.assertEquals(200, code) self.assertEquals([ - {"user_id": "@banana:test", "presence": OFFLINE, "state": OFFLINE}, + {"user_id": "@banana:test", "presence": OFFLINE}, ], response) self.datastore.get_presence_list.assert_called_with( @@ -311,9 +312,11 @@ class PresenceEventStreamTestCase(unittest.TestCase): self.room_members = [self.u_apple, self.u_banana] self.mock_datastore.set_presence_state.return_value = defer.succeed( - {"state": ONLINE}) + {"state": ONLINE} + ) self.mock_datastore.get_presence_list.return_value = defer.succeed( - []) + [] + ) (code, response) = yield self.mock_resource.trigger("GET", "/events?timeout=0", None) @@ -329,9 +332,11 @@ class PresenceEventStreamTestCase(unittest.TestCase): ) self.mock_datastore.set_presence_state.return_value = defer.succeed( - {"state": ONLINE}) + {"state": ONLINE} + ) self.mock_datastore.get_presence_list.return_value = defer.succeed( - []) + [] + ) yield self.presence.set_state(self.u_banana, self.u_banana, state={"presence": ONLINE} @@ -346,7 +351,6 @@ class PresenceEventStreamTestCase(unittest.TestCase): "content": { "user_id": "@banana:test", "presence": ONLINE, - "state": ONLINE, "displayname": "Frank", "last_active_ago": 0, }}, |