More tests

This commit is contained in:
klemek
2020-09-06 12:33:49 +02:00
parent 8934acb004
commit c14993653e
2 changed files with 67 additions and 15 deletions
+15
View File
@@ -1,4 +1,5 @@
from unittest import TestCase
from unittest.mock import MagicMock, patch
import asyncio
@@ -12,3 +13,17 @@ class AsyncTestCase(TestCase):
def _await(self, fn):
return self.loop.run_until_complete(fn)
def pass_through(arg):
return arg
def patch_discord(test):
def wrapper(*args):
m = MagicMock()
m.event = pass_through
with patch("discord.Client", return_value=m):
test(*args)
return wrapper