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/storage/test_devices.py | |
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/storage/test_devices.py')
-rw-r--r-- | tests/storage/test_devices.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/storage/test_devices.py b/tests/storage/test_devices.py index f03807c8f9..58ab41cf26 100644 --- a/tests/storage/test_devices.py +++ b/tests/storage/test_devices.py @@ -58,13 +58,13 @@ class DeviceStoreTestCase(HomeserverTestCase): res = self.get_success(self.store.get_device("user_id", "device_id")) assert res is not None - self.assertDictContainsSubset( + self.assertLessEqual( { "user_id": "user_id", "device_id": "device_id", "display_name": "display_name", - }, - res, + }.items(), + res.items(), ) def test_get_devices_by_user(self) -> None: @@ -80,21 +80,21 @@ class DeviceStoreTestCase(HomeserverTestCase): res = self.get_success(self.store.get_devices_by_user("user_id")) self.assertEqual(2, len(res.keys())) - self.assertDictContainsSubset( + self.assertLessEqual( { "user_id": "user_id", "device_id": "device1", "display_name": "display_name 1", - }, - res["device1"], + }.items(), + res["device1"].items(), ) - self.assertDictContainsSubset( + self.assertLessEqual( { "user_id": "user_id", "device_id": "device2", "display_name": "display_name 2", - }, - res["device2"], + }.items(), + res["device2"].items(), ) def test_count_devices_by_users(self) -> None: |