Browse Source

ModInfo test

dave/xdcc
dave 4 years ago
parent
commit
3b6d4ff33d
  1. 1
      pyircbot/modulebase.py
  2. 10
      tests/modules/test_modinfo.py

1
pyircbot/modulebase.py

@ -235,7 +235,6 @@ class command(hook):
for keyword in self.keywords:
single = self._validate_prefixedcommand(msg, keyword, bot_nick)
if single:
print(single)
return single
return False

10
tests/modules/test_modinfo.py

@ -19,11 +19,13 @@ def test_helpindex(helpbot):
def test_help(helpbot):
helpbot.feed_line(".help")
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)
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)
def test_help_one(helpbot):
helpbot.feed_line(".help .helpindex")
helpbot.act_PRIVMSG.assert_called_once_with('#test', 'RTFM: .helpindex: helpindex show a short list of all commands')
helpbot.act_PRIVMSG.assert_called_once_with('#test',
'RTFM: .helpindex: (.helpindex) show a short list of all commands')

Loading…
Cancel
Save