diff options
author | 2019-09-18 15:48:08 -0500 | |
---|---|---|
committer | 2019-09-18 15:48:08 -0500 | |
commit | d6aab9421573eea5bfe9da8d63265e0c2451d194 (patch) | |
tree | 3f6e53606f55a04505a71a885fff2136f10145c3 /tests/conftest.py | |
parent | Infraction Date Humanization (diff) | |
parent | Merge 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.py | 32 |
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 |