summary refs log tree commit diff
path: root/tests/handlers
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-07-21 15:55:13 +0100
committerRichard van der Hoff <richard@matrix.org>2016-07-21 15:57:28 +0100
commit55abbe1850efff95efe9935873b666e5fc4bf0e9 (patch)
tree5d577d5b181506be155252525db762bb922bf216 /tests/handlers
parentMerge pull request #943 from matrix-org/rav/get_device_api (diff)
downloadsynapse-55abbe1850efff95efe9935873b666e5fc4bf0e9.tar.xz
make /devices return a list
Turns out I specced this to return a list of devices rather than a dict of them
Diffstat (limited to 'tests/handlers')
-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):