aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2020-07-29 20:14:52 +0200
committerGravatar Leon Sandøy <[email protected]>2020-07-29 20:14:52 +0200
commite0837f4f6dd7c5c2d6fc0811dccfaf1ecae768ba (patch)
tree3a33d8ab90447f01044deeac3a10b4ba00826552 /tests
parentFix a bad type annotation. (diff)
Restructure bot.filter_list_cache.
This is an optimization designed to eliminate all the list comprehensions we were doing inside antimalware and filtering. The cache is now structured so that the content is the key and the metadata is the value.
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/test_antimalware.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/bot/cogs/test_antimalware.py b/tests/bot/cogs/test_antimalware.py
index 664fa8f19..82eadf226 100644
--- a/tests/bot/cogs/test_antimalware.py
+++ b/tests/bot/cogs/test_antimalware.py
@@ -15,11 +15,11 @@ class AntiMalwareCogTests(unittest.IsolatedAsyncioTestCase):
"""Sets up fresh objects for each test."""
self.bot = MockBot()
self.bot.filter_list_cache = {
- "file_format.True": [
- {"content": ".first"},
- {"content": ".second"},
- {"content": ".third"}
- ]
+ "file_format.True": {
+ ".first": {},
+ ".second": {},
+ ".third": {},
+ }
}
self.cog = antimalware.AntiMalware(self.bot)
self.message = MockMessage()