diff options
| author | 2020-05-25 20:44:35 +0200 | |
|---|---|---|
| committer | 2020-05-25 20:44:35 +0200 | |
| commit | 0ede719d7beb36f476ac26f948ab940882978476 (patch) | |
| tree | a6a67b5300a5f3d1e3b2ba46100234559ffe8bb7 /tests/bot | |
| parent | AntiMalware Refactor - Moved embed descriptions into constants, added tests f... (diff) | |
AntiMalware tests - Switched from monkeypatch to unittest.patch
Diffstat (limited to 'tests/bot')
| -rw-r--r-- | tests/bot/cogs/test_antimalware.py | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/tests/bot/cogs/test_antimalware.py b/tests/bot/cogs/test_antimalware.py index fab063201..f219fc1ba 100644 --- a/tests/bot/cogs/test_antimalware.py +++ b/tests/bot/cogs/test_antimalware.py @@ -1,5 +1,5 @@  import unittest -from unittest.mock import AsyncMock, Mock +from unittest.mock import AsyncMock, Mock, patch  from discord import NotFound @@ -10,6 +10,7 @@ from tests.helpers import MockAttachment, MockBot, MockMessage, MockRole  MODULE = "bot.cogs.antimalware" +@patch(f"{MODULE}.AntiMalwareConfig.whitelist", new=[".first", ".second", ".third"])  class AntiMalwareCogTests(unittest.IsolatedAsyncioTestCase):      """Test the AntiMalware cog.""" @@ -18,7 +19,6 @@ class AntiMalwareCogTests(unittest.IsolatedAsyncioTestCase):          self.bot = MockBot()          self.cog = antimalware.AntiMalware(self.bot)          self.message = MockMessage() -        AntiMalwareConfig.whitelist = [".first", ".second", ".third"]      async def test_message_with_allowed_attachment(self):          """Messages with allowed extensions should not be deleted""" | 
