diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-17 16:58:59 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-17 16:58:59 +0100 |
commit | bcf512193705a0aaca2da3bbfd62ce6f4cb65980 (patch) | |
tree | 31d74cbe82b3ba570338b680a0c28d98d94b6335 /tests/storage/test_directory.py | |
parent | Unit tests for (some) room events via the RoomStore (diff) | |
download | synapse-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.py | 17 |
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)) + ) |