mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 06:44:55 -04:00
Add type hints to DictionaryCache and TTLCache. (#9442)
This commit is contained in:
parent
7dcf3fd221
commit
01dd90b0f0
7 changed files with 96 additions and 67 deletions
|
@ -377,14 +377,11 @@ class StateStoreTestCase(tests.unittest.TestCase):
|
|||
#######################################################
|
||||
# deliberately remove e2 (room name) from the _state_group_cache
|
||||
|
||||
(
|
||||
is_all,
|
||||
known_absent,
|
||||
state_dict_ids,
|
||||
) = self.state_datastore._state_group_cache.get(group)
|
||||
cache_entry = self.state_datastore._state_group_cache.get(group)
|
||||
state_dict_ids = cache_entry.value
|
||||
|
||||
self.assertEqual(is_all, True)
|
||||
self.assertEqual(known_absent, set())
|
||||
self.assertEqual(cache_entry.full, True)
|
||||
self.assertEqual(cache_entry.known_absent, set())
|
||||
self.assertDictEqual(
|
||||
state_dict_ids,
|
||||
{
|
||||
|
@ -403,14 +400,11 @@ class StateStoreTestCase(tests.unittest.TestCase):
|
|||
fetched_keys=((e1.type, e1.state_key),),
|
||||
)
|
||||
|
||||
(
|
||||
is_all,
|
||||
known_absent,
|
||||
state_dict_ids,
|
||||
) = self.state_datastore._state_group_cache.get(group)
|
||||
cache_entry = self.state_datastore._state_group_cache.get(group)
|
||||
state_dict_ids = cache_entry.value
|
||||
|
||||
self.assertEqual(is_all, False)
|
||||
self.assertEqual(known_absent, {(e1.type, e1.state_key)})
|
||||
self.assertEqual(cache_entry.full, False)
|
||||
self.assertEqual(cache_entry.known_absent, {(e1.type, e1.state_key)})
|
||||
self.assertDictEqual(state_dict_ids, {(e1.type, e1.state_key): e1.event_id})
|
||||
|
||||
############################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue