summary refs log tree commit diff
path: root/tests/storage/test_directory.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-30 11:31:22 +0100
committerErik Johnston <erik@matrix.org>2014-09-30 11:31:42 +0100
commite06adc6d7e645e5116c28d2b5756a70bb8f4f240 (patch)
tree4c7f2d72fb6bd321411e013c7d9f20c2bd367488 /tests/storage/test_directory.py
parentRe-wrap content after latest additions (diff)
downloadsynapse-e06adc6d7e645e5116c28d2b5756a70bb8f4f240.tar.xz
SYN-2: Allow server admins to delete room aliases
Diffstat (limited to 'tests/storage/test_directory.py')
-rw-r--r--tests/storage/test_directory.py25
1 files changed, 21 insertions, 4 deletions
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))
         )