summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorDavid Baker <dbkr@users.noreply.github.com>2016-07-21 17:00:26 +0100
committerGitHub <noreply@github.com>2016-07-21 17:00:26 +0100
commit68a92afcffa6d642398c5eac6ee0beeadd6e97d3 (patch)
tree5d577d5b181506be155252525db762bb922bf216 /tests
parentMerge pull request #943 from matrix-org/rav/get_device_api (diff)
parentmake /devices return a list (diff)
downloadsynapse-68a92afcffa6d642398c5eac6ee0beeadd6e97d3.tar.xz
Merge pull request #944 from matrix-org/rav/devices_returns_list
make /devices return a list
Diffstat (limited to '')
-rw-r--r--tests/handlers/test_device.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/handlers/test_device.py b/tests/handlers/test_device.py
index 87c3c75aea..331aa13fed 100644
--- a/tests/handlers/test_device.py
+++ b/tests/handlers/test_device.py
@@ -84,28 +84,31 @@ class DeviceTestCase(unittest.TestCase):
         yield self._record_users()
 
         res = yield self.handler.get_devices_by_user(user1)
-        self.assertEqual(3, len(res.keys()))
+        self.assertEqual(3, len(res))
+        device_map = {
+            d["device_id"]: d for d in res
+        }
         self.assertDictContainsSubset({
             "user_id": user1,
             "device_id": "xyz",
             "display_name": "display 0",
             "last_seen_ip": None,
             "last_seen_ts": None,
-        }, res["xyz"])
+        }, device_map["xyz"])
         self.assertDictContainsSubset({
             "user_id": user1,
             "device_id": "fco",
             "display_name": "display 1",
             "last_seen_ip": "ip1",
             "last_seen_ts": 1000000,
-        }, res["fco"])
+        }, device_map["fco"])
         self.assertDictContainsSubset({
             "user_id": user1,
             "device_id": "abc",
             "display_name": "display 2",
             "last_seen_ip": "ip3",
             "last_seen_ts": 3000000,
-        }, res["abc"])
+        }, device_map["abc"])
 
     @defer.inlineCallbacks
     def test_get_device(self):