diff options
author | V02460 <V02460@gmail.com> | 2023-08-25 21:05:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-25 15:05:10 -0400 |
commit | 84f441f88f51d3f94e1616e1e5507df0dadb6de8 (patch) | |
tree | 717bc7464290b887d2e2c355659104d5b7613972 /tests/handlers | |
parent | service-identity, incremental, and setuptools-rust now have type hints. (#16186) (diff) | |
download | synapse-84f441f88f51d3f94e1616e1e5507df0dadb6de8.tar.xz |
Prepare unit tests for Python 3.12 (#16099)
Diffstat (limited to 'tests/handlers')
-rw-r--r-- | tests/handlers/test_device.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/handlers/test_device.py b/tests/handlers/test_device.py index dca539d203..55a4f95ef3 100644 --- a/tests/handlers/test_device.py +++ b/tests/handlers/test_device.py @@ -122,50 +122,50 @@ class DeviceTestCase(unittest.HomeserverTestCase): self.assertEqual(3, len(res)) device_map = {d["device_id"]: d for d in res} - self.assertDictContainsSubset( + self.assertLessEqual( { "user_id": user1, "device_id": "xyz", "display_name": "display 0", "last_seen_ip": None, "last_seen_ts": None, - }, - device_map["xyz"], + }.items(), + device_map["xyz"].items(), ) - self.assertDictContainsSubset( + self.assertLessEqual( { "user_id": user1, "device_id": "fco", "display_name": "display 1", "last_seen_ip": "ip1", "last_seen_ts": 1000000, - }, - device_map["fco"], + }.items(), + device_map["fco"].items(), ) - self.assertDictContainsSubset( + self.assertLessEqual( { "user_id": user1, "device_id": "abc", "display_name": "display 2", "last_seen_ip": "ip3", "last_seen_ts": 3000000, - }, - device_map["abc"], + }.items(), + device_map["abc"].items(), ) def test_get_device(self) -> None: self._record_users() res = self.get_success(self.handler.get_device(user1, "abc")) - self.assertDictContainsSubset( + self.assertLessEqual( { "user_id": user1, "device_id": "abc", "display_name": "display 2", "last_seen_ip": "ip3", "last_seen_ts": 3000000, - }, - res, + }.items(), + res.items(), ) def test_delete_device(self) -> None: |