aboutsummaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorGravatar Daniel Brown <[email protected]>2019-09-18 15:48:08 -0500
committerGravatar GitHub <[email protected]>2019-09-18 15:48:08 -0500
commitd6aab9421573eea5bfe9da8d63265e0c2451d194 (patch)
tree3f6e53606f55a04505a71a885fff2136f10145c3 /tests/conftest.py
parentInfraction Date Humanization (diff)
parentMerge pull request #431 from python-discord/bot-cogs-information-tests (diff)
Merge branch 'master' into hemlock-infraction-date-humanization
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
new file mode 100644
index 000000000..d3de4484d
--- /dev/null
+++ b/tests/conftest.py
@@ -0,0 +1,32 @@
+from unittest.mock import MagicMock
+
+import pytest
+
+from bot.constants import Roles
+from tests.helpers import AsyncMock
+
+
+def moderator_role():
+ mock = MagicMock()
+ mock.id = Roles.moderator
+ mock.name = 'Moderator'
+ mock.mention = f'&{mock.name}'
+ return mock
+
+
+def simple_bot():
+ mock = MagicMock()
+ mock._before_invoke = AsyncMock()
+ mock._after_invoke = AsyncMock()
+ mock.can_run = AsyncMock()
+ mock.can_run.return_value = True
+ return mock
+
+
+def simple_ctx(simple_bot):
+ mock = MagicMock()
+ mock.bot = simple_bot
+ return mock