aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2020-03-11 00:01:58 +0100
committerGravatar Numerlor <[email protected]>2020-03-11 00:01:58 +0100
commit85c439fbf78f59ff314f4f9daef1467d486709c3 (patch)
treed3c75c46c764052fc9442993c7e02fb350bb9a9e /tests
parentAdd alert with silenced channels on `cog_unload`. (diff)
Remove unnecessary args from test cases.
Needless call args which were constant were kept in the test cases, resulting in redundant code, the args were moved directly into the function call.
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/moderation/test_silence.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/bot/cogs/moderation/test_silence.py b/tests/bot/cogs/moderation/test_silence.py
index 53b3fd388..1341911d5 100644
--- a/tests/bot/cogs/moderation/test_silence.py
+++ b/tests/bot/cogs/moderation/test_silence.py
@@ -39,18 +39,18 @@ class SilenceTests(unittest.TestCase):
def test_silence_sent_correct_discord_message(self):
"""Check if proper message was sent when called with duration in channel with previous state."""
test_cases = (
- ((self.cog, self.ctx, 0.0001), f"{Emojis.check_mark} #channel silenced for 0.0001 minute(s).", True,),
- ((self.cog, self.ctx, None), f"{Emojis.check_mark} #channel silenced indefinitely.", True,),
- ((self.cog, self.ctx, 5), f"{Emojis.cross_mark} #channel is already silenced.", False,),
+ (0.0001, f"{Emojis.check_mark} #channel silenced for 0.0001 minute(s).", True,),
+ (None, f"{Emojis.check_mark} #channel silenced indefinitely.", True,),
+ (5, f"{Emojis.cross_mark} #channel is already silenced.", False,),
)
- for silence_call_args, result_message, _silence_patch_return in test_cases:
+ for duration, result_message, _silence_patch_return in test_cases:
with self.subTest(
- silence_duration=silence_call_args[-1],
+ silence_duration=duration,
result_message=result_message,
starting_unsilenced_state=_silence_patch_return
):
with mock.patch.object(self.cog, "_silence", return_value=_silence_patch_return):
- asyncio.run(self.cog.silence.callback(*silence_call_args))
+ asyncio.run(self.cog.silence.callback(self.cog, self.ctx, duration))
self.ctx.send.call_args.assert_called_once_with(result_message)
def test_unsilence_sent_correct_discord_message(self):