From e06adc6d7e645e5116c28d2b5756a70bb8f4f240 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 30 Sep 2014 11:31:22 +0100 Subject: SYN-2: Allow server admins to delete room aliases --- tests/storage/test_directory.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'tests/storage/test_directory.py') diff --git a/tests/storage/test_directory.py b/tests/storage/test_directory.py index 7e8e7e1e83..e9c242cc07 100644 --- a/tests/storage/test_directory.py +++ b/tests/storage/test_directory.py @@ -30,7 +30,8 @@ class DirectoryStoreTestCase(unittest.TestCase): db_pool = SQLiteMemoryDbPool() yield db_pool.prepare() - hs = HomeServer("test", + hs = HomeServer( + "test", db_pool=db_pool, ) @@ -60,9 +61,25 @@ class DirectoryStoreTestCase(unittest.TestCase): servers=["test"], ) - self.assertObjectHasAttributes( - {"room_id": self.room.to_string(), - "servers": ["test"]}, + { + "room_id": self.room.to_string(), + "servers": ["test"], + }, + (yield 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"], + ) + + room_id = yield 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)) ) -- cgit 1.4.1