aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar S. Co1 <[email protected]>2019-10-25 09:19:39 -0400
committerGravatar GitHub <[email protected]>2019-10-25 09:19:39 -0400
commit586aebb3593b448b65efdfe7a8759e834b6bf407 (patch)
tree190628d6b35972073a014e8ab4264e1402e7991e /tests
parentMerge pull request #550 from python-discord/###-filtering-devtest (diff)
parentMerge branch 'master' into moderator-channel-check (diff)
Merge pull request #543 from atmishra/moderator-channel-check
Restrict ModManagement commands to moderation channels
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/utils/test_checks.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/bot/utils/test_checks.py b/tests/bot/utils/test_checks.py
index 22dc93073..19b758336 100644
--- a/tests/bot/utils/test_checks.py
+++ b/tests/bot/utils/test_checks.py
@@ -41,3 +41,11 @@ class ChecksTests(unittest.TestCase):
role_id = 42
self.ctx.author.roles.append(MockRole(role_id=role_id))
self.assertTrue(checks.without_role_check(self.ctx, role_id + 10))
+
+ def test_in_channel_check_for_correct_channel(self):
+ self.ctx.channel.id = 42
+ self.assertTrue(checks.in_channel_check(self.ctx, *[42]))
+
+ def test_in_channel_check_for_incorrect_channel(self):
+ self.ctx.channel.id = 42 + 10
+ self.assertFalse(checks.in_channel_check(self.ctx, *[42]))