From 750c99bbe7e42c1e90eca3f57bb8f2281290bebe Mon Sep 17 00:00:00 2001 From: Kevin ICOL Date: Mon, 30 Nov 2020 08:52:08 +0100 Subject: [PATCH] feat: improve name of function --- synapse/handlers/room.py | 2 +- synapse/storage/databases/main/room.py | 4 ++-- tests/handlers/watcha_test_room.py | 4 ++-- tests/rest/client/v1/test_rooms.py | 2 +- tests/rest/client/v1/test_watcha.py | 2 +- tests/storage/test_room.py | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 293c22a57..a83d3a70b 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -1490,7 +1490,7 @@ class WatchaRoomNextcloudMappingHandler(BaseHandler): nextcloud_requester, nextcloud_directory_path, room_id ) - await self.store.set_room_mapping_with_nextcloud_directory( + await self.store.map_room_with_nextcloud_directory( room_id, nextcloud_directory_path, new_share_id ) diff --git a/synapse/storage/databases/main/room.py b/synapse/storage/databases/main/room.py index 814efd38e..6b6df9ab9 100644 --- a/synapse/storage/databases/main/room.py +++ b/synapse/storage/databases/main/room.py @@ -1637,7 +1637,7 @@ class RoomStore(RoomBackgroundUpdateStore, RoomWorkerStore, SearchStore): desc="get_nextcloud_share_id_from_roomID", ) - async def set_room_mapping_with_nextcloud_directory( + async def map_room_with_nextcloud_directory( self, room_id, directory_path, share_id ): """ Set mapping between Watcha room and Nextcloud directory. @@ -1651,7 +1651,7 @@ class RoomStore(RoomBackgroundUpdateStore, RoomWorkerStore, SearchStore): "directory_path": directory_path, "share_id": share_id, }, - desc="set_room_mapping_with_nextcloud_directory", + desc="map_room_with_nextcloud_directory", ) async def deleted_room_mapping_with_nextcloud_directory(self, room_id): diff --git a/tests/handlers/watcha_test_room.py b/tests/handlers/watcha_test_room.py index cfdecef87..7e614a197 100644 --- a/tests/handlers/watcha_test_room.py +++ b/tests/handlers/watcha_test_room.py @@ -105,7 +105,7 @@ class WatchaRoomNextcloudMappingTestCase(unittest.HomeserverTestCase): def test_update_existing_room_nextcloud_mapping(self): self.get_success( - self.store.set_room_mapping_with_nextcloud_directory( + self.store.map_room_with_nextcloud_directory( self.room_id, "/directory", 2 ) ) @@ -143,7 +143,7 @@ class WatchaRoomNextcloudMappingTestCase(unittest.HomeserverTestCase): def test_delete_existing_room_nextcloud_mapping(self): self.get_success( - self.store.set_room_mapping_with_nextcloud_directory( + self.store.map_room_with_nextcloud_directory( self.room_id, "/directory", 2 ) ) diff --git a/tests/rest/client/v1/test_rooms.py b/tests/rest/client/v1/test_rooms.py index 3e5a2ad51..7e4d18871 100644 --- a/tests/rest/client/v1/test_rooms.py +++ b/tests/rest/client/v1/test_rooms.py @@ -2237,7 +2237,7 @@ class WatchaMembershipNextcloudSharingTestCase(unittest.HomeserverTestCase): # map a room with a Nextcloud directory : self.get_success( - self.store.set_room_mapping_with_nextcloud_directory( + self.store.map_room_with_nextcloud_directory( self.room_id, "/directory", 1 ) ) diff --git a/tests/rest/client/v1/test_watcha.py b/tests/rest/client/v1/test_watcha.py index fad9a30b7..637dba65e 100644 --- a/tests/rest/client/v1/test_watcha.py +++ b/tests/rest/client/v1/test_watcha.py @@ -401,7 +401,7 @@ class WatchaSendNextcloudActivityToWatchaRoomServletTestCase( room_id = self._create_room() mapping_value["room_id"] = room_id - await self.store.set_room_mapping_with_nextcloud_directory( + await self.store.map_room_with_nextcloud_directory( room_id, mapping_value["path"], mapping_value["share_id"] ) diff --git a/tests/storage/test_room.py b/tests/storage/test_room.py index 80c56f1bb..a3397e438 100644 --- a/tests/storage/test_room.py +++ b/tests/storage/test_room.py @@ -177,7 +177,7 @@ class WatchaRoomEventsStoreTestCase(unittest.HomeserverTestCase): # Set mapping between a room and a nextcloud directory : yield defer.ensureDeferred( - self.store.set_room_mapping_with_nextcloud_directory( + self.store.map_room_with_nextcloud_directory( self.room_id, self.directory_path, self.share_id ) ) @@ -221,7 +221,7 @@ class WatchaRoomEventsStoreTestCase(unittest.HomeserverTestCase): new_share_id = 2 yield defer.ensureDeferred( - self.store.set_room_mapping_with_nextcloud_directory( + self.store.map_room_with_nextcloud_directory( self.room_id, new_directory_path, new_share_id ) )