diff options
author | 2020-10-11 13:04:35 +0300 | |
---|---|---|
committer | 2020-10-11 13:04:35 +0300 | |
commit | 4d967cd27d049bffc2585d2cc8f381f44f59ca61 (patch) | |
tree | 45795c38a6dea887225f9d8af15f34009b0a8186 /tests | |
parent | Improve voice gate messages deletion (diff) |
Create test for permanent voice ban
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bot/exts/moderation/infraction/test_infractions.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/bot/exts/moderation/infraction/test_infractions.py b/tests/bot/exts/moderation/infraction/test_infractions.py index be1b649e1..27f346648 100644 --- a/tests/bot/exts/moderation/infraction/test_infractions.py +++ b/tests/bot/exts/moderation/infraction/test_infractions.py @@ -53,3 +53,20 @@ class TruncationTests(unittest.IsolatedAsyncioTestCase): self.cog.apply_infraction.assert_awaited_once_with( self.ctx, {"foo": "bar"}, self.target, self.target.kick.return_value ) + + +class VoiceBanTests(unittest.IsolatedAsyncioTestCase): + """Tests for voice ban related functions and commands.""" + + def setUp(self): + self.bot = MockBot() + self.mod = MockMember() + self.user = MockMember() + self.ctx = MockContext(bot=self.bot, author=self.mod) + self.cog = Infractions(self.bot) + + async def test_permanent_voice_ban(self): + """Should call voice ban applying function.""" + self.cog.apply_voice_ban = AsyncMock() + self.assertIsNone(await self.cog.voice_ban(self.cog, self.ctx, self.user, reason="foobar")) + self.cog.apply_voice_ban.assert_awaited_once_with(self.ctx, self.user, "foobar") |