aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jannes Jonkers <[email protected]>2020-05-07 18:11:44 +0200
committerGravatar Jannes Jonkers <[email protected]>2020-05-07 18:11:44 +0200
commit601ff03823deb842d74f4689fecb68f7ce1693e6 (patch)
tree04322fe43f12d1081ccd5c5e182f9f1e1efc22e1
parentMerge pull request #919 from python-discord/bug/backend/911/log-listener-exce... (diff)
AntiMalware Tests - Added unittest for message without attachment
-rw-r--r--tests/bot/cogs/test_antimalware.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/bot/cogs/test_antimalware.py b/tests/bot/cogs/test_antimalware.py
new file mode 100644
index 000000000..41ca19e17
--- /dev/null
+++ b/tests/bot/cogs/test_antimalware.py
@@ -0,0 +1,20 @@
+import asyncio
+import unittest
+
+from bot.cogs import antimalware
+from tests.helpers import MockBot, MockMessage
+
+
+class AntiMalwareCogTests(unittest.TestCase):
+ """Test the AntiMalware cog."""
+
+ def setUp(self):
+ """Sets up fresh objects for each test."""
+ self.bot = MockBot()
+ self.cog = antimalware.AntiMalware(self.bot)
+ self.message = MockMessage()
+
+ def test_message_without_attachment(self):
+ """Messages without attachments should result in no action."""
+ coroutine = self.cog.on_message(self.message)
+ self.assertIsNone(asyncio.run(coroutine))