summary refs log tree commit diff
path: root/tests/storage/test_directory.py
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2014-09-17 16:58:59 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-09-17 16:58:59 +0100
commitbcf512193705a0aaca2da3bbfd62ce6f4cb65980 (patch)
tree31d74cbe82b3ba570338b680a0c28d98d94b6335 /tests/storage/test_directory.py
parentUnit tests for (some) room events via the RoomStore (diff)
downloadsynapse-bcf512193705a0aaca2da3bbfd62ce6f4cb65980.tar.xz
Neaten more of the storage layer tests with assertObjectHasAttributes; more standardisation on test layout
Diffstat (limited to 'tests/storage/test_directory.py')
-rw-r--r--tests/storage/test_directory.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/storage/test_directory.py b/tests/storage/test_directory.py
index 9a80bf6c04..7e8e7e1e83 100644
--- a/tests/storage/test_directory.py
+++ b/tests/storage/test_directory.py
@@ -47,9 +47,10 @@ class DirectoryStoreTestCase(unittest.TestCase):
             servers=["test"],
         )
 
-        aliases = yield self.store.get_aliases_for_room(self.room.to_string())
-
-        self.assertEquals(["#my-room:test"], aliases)
+        self.assertEquals(
+            ["#my-room:test"],
+            (yield self.store.get_aliases_for_room(self.room.to_string()))
+        )
 
     @defer.inlineCallbacks
     def test_alias_to_room(self):
@@ -59,9 +60,9 @@ class DirectoryStoreTestCase(unittest.TestCase):
             servers=["test"],
         )
 
-        mapping = yield self.store.get_association_from_room_alias(
-            self.alias
-        )
 
-        self.assertEquals(self.room.to_string(), mapping.room_id)
-        self.assertEquals(["test"], mapping.servers)
+        self.assertObjectHasAttributes(
+            {"room_id": self.room.to_string(),
+             "servers": ["test"]},
+            (yield self.store.get_association_from_room_alias(self.alias))
+        )