From 1a3458c5010697375408dfb239e2517983f64698 Mon Sep 17 00:00:00 2001 From: Kai Date: Fri, 6 May 2022 23:35:57 +0200 Subject: [PATCH] fixed forgotten docstring and added better variable-naming --- rocketchat_API/APISections/channels.py | 2 +- tests/test_channels.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/rocketchat_API/APISections/channels.py b/rocketchat_API/APISections/channels.py index b472d06..00ac562 100644 --- a/rocketchat_API/APISections/channels.py +++ b/rocketchat_API/APISections/channels.py @@ -138,7 +138,7 @@ def channels_rename(self, room_id, name, **kwargs): ) def channels_set_default(self, room_id, default, **kwargs): - """Sets the description for the channel.""" + """Sets whether the channel is a default channel or not.""" return self.call_api_post( "channels.setDefault", roomId=room_id, diff --git a/tests/test_channels.py b/tests/test_channels.py index 53a1a27..1befa13 100644 --- a/tests/test_channels.py +++ b/tests/test_channels.py @@ -383,9 +383,11 @@ def test_channels_online(logged_rocket): def test_channels_set_default(logged_rocket): - results = logged_rocket.channels_set_default( + channels_set_default = logged_rocket.channels_set_default( room_id="GENERAL", default=False ).json() - assert results.get("channel").get("default") is False - results = logged_rocket.channels_set_default(room_id="GENERAL", default=True).json() - assert results.get("channel").get("default") + assert channels_set_default.get("channel").get("default") is False + channels_set_default = logged_rocket.channels_set_default( + room_id="GENERAL", default=True + ).json() + assert channels_set_default.get("channel").get("default")