mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-10 01:11:20 -05:00
Convert directory, e2e_room_keys, end_to_end_keys, monthly_active_users database to async (#8042)
This commit is contained in:
parent
f3fe6961b2
commit
7f837959ea
10 changed files with 141 additions and 120 deletions
|
|
@ -34,8 +34,10 @@ class DirectoryStoreTestCase(unittest.TestCase):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def test_room_to_alias(self):
|
||||
yield self.store.create_room_alias_association(
|
||||
room_alias=self.alias, room_id=self.room.to_string(), servers=["test"]
|
||||
yield defer.ensureDeferred(
|
||||
self.store.create_room_alias_association(
|
||||
room_alias=self.alias, room_id=self.room.to_string(), servers=["test"]
|
||||
)
|
||||
)
|
||||
|
||||
self.assertEquals(
|
||||
|
|
@ -45,24 +47,36 @@ class DirectoryStoreTestCase(unittest.TestCase):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def test_alias_to_room(self):
|
||||
yield self.store.create_room_alias_association(
|
||||
room_alias=self.alias, room_id=self.room.to_string(), servers=["test"]
|
||||
yield defer.ensureDeferred(
|
||||
self.store.create_room_alias_association(
|
||||
room_alias=self.alias, room_id=self.room.to_string(), servers=["test"]
|
||||
)
|
||||
)
|
||||
|
||||
self.assertObjectHasAttributes(
|
||||
{"room_id": self.room.to_string(), "servers": ["test"]},
|
||||
(yield self.store.get_association_from_room_alias(self.alias)),
|
||||
(
|
||||
yield defer.ensureDeferred(
|
||||
self.store.get_association_from_room_alias(self.alias)
|
||||
)
|
||||
),
|
||||
)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def test_delete_alias(self):
|
||||
yield self.store.create_room_alias_association(
|
||||
room_alias=self.alias, room_id=self.room.to_string(), servers=["test"]
|
||||
yield defer.ensureDeferred(
|
||||
self.store.create_room_alias_association(
|
||||
room_alias=self.alias, room_id=self.room.to_string(), servers=["test"]
|
||||
)
|
||||
)
|
||||
|
||||
room_id = yield self.store.delete_room_alias(self.alias)
|
||||
room_id = yield defer.ensureDeferred(self.store.delete_room_alias(self.alias))
|
||||
self.assertEqual(self.room.to_string(), room_id)
|
||||
|
||||
self.assertIsNone(
|
||||
(yield self.store.get_association_from_room_alias(self.alias))
|
||||
(
|
||||
yield defer.ensureDeferred(
|
||||
self.store.get_association_from_room_alias(self.alias)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue