pyircbot/tests/modules/test_modinfo.py

32 lines
959 B
Python
Raw Permalink Normal View History

2017-11-27 19:04:22 -08:00
import pytest
from tests.lib import * # NOQA - fixtures
2017-12-02 23:48:44 -08:00
from unittest.mock import call
2017-11-27 19:04:22 -08:00
@pytest.fixture
2017-12-02 23:48:44 -08:00
def helpbot(fakebot):
"""
Provide a bot loaded with the ModInfo module
"""
2017-11-27 19:04:22 -08:00
fakebot.loadmodule("ModInfo")
return fakebot
2017-12-02 23:48:44 -08:00
def test_helpindex(helpbot):
helpbot.feed_line(".helpindex")
helpbot.act_PRIVMSG.assert_called_once_with('#test', 'chatter: commands: .help, .helpindex')
2017-11-27 19:04:22 -08:00
2017-12-02 23:48:44 -08:00
def test_help(helpbot):
helpbot.feed_line(".help")
2018-02-12 21:33:18 -08:00
helpbot.act_PRIVMSG.assert_has_calls(
[call('#test', 'ModInfo .help [command] show the manual for all or [commands] '),
call('#test', 'ModInfo .helpindex show a short list of all commands ')],
any_order=True)
2017-12-02 23:48:44 -08:00
def test_help_one(helpbot):
helpbot.feed_line(".help .helpindex")
2018-02-12 21:33:18 -08:00
helpbot.act_PRIVMSG.assert_called_once_with('#test',
'RTFM: .helpindex: (.helpindex) show a short list of all commands')