More tests
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user