aboutsummaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
blob: d3de4484d6dbd9cf07891d68a03ce8c97feaaca9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from unittest.mock import MagicMock

import pytest

from bot.constants import Roles
from tests.helpers import AsyncMock


@pytest.fixture()
def moderator_role():
    mock = MagicMock()
    mock.id = Roles.moderator
    mock.name = 'Moderator'
    mock.mention = f'&{mock.name}'
    return mock


@pytest.fixture()
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


@pytest.fixture()
def simple_ctx(simple_bot):
    mock = MagicMock()
    mock.bot = simple_bot
    return mock