def test_admin_part_public(public_bot): yield from admin_plugins.part(public_bot, why='...') assert public_bot.protocol.messages == [ Message('PART', '#czarnobyl', ':...'), ]
def test_admin_kick_public(public_bot): yield from admin_plugins.kick(public_bot, who='socek', why='...') assert public_bot.protocol.messages == [ Message('KICK', '#czarnobyl', 'socek', ':...'), ]
def test_creeper(public_bot): yield from creeper(public_bot) assert public_bot.protocol.messages == [ Message('KICK', '#czarnobyl', 'socek', ':Alert!'), ]
def test_kick_bot(protocol): protocol.config['main']['nick'] = 'firemark' data = [':socek!a@b', 'KICK', '#czarnobyl', 'firemark'] ctrl = execute_message(protocol, data) assert protocol.messages == [Message('JOIN', '#czarnobyl')] ctrl.log.assert_called_once_with('#czarnobyl', 'socek KICK firemark')
def test_mode(protocol): bot = make_bot(protocol) bot.mode('#czarnobyl', '+oo', 'lol') assert protocol.messages == [Message('MODE', 'lol', '#czarnobyl', '+oo')]
def test_command_msg(protocol): bot = make_bot(protocol) bot.command_msg('WTF', 'dunno lol') assert protocol.messages == [Message('WTF', ':dunno lol')]
def test_command(protocol): bot = make_bot(protocol) bot.command('WTF') assert protocol.messages == [Message('WTF')]
def test_kick(protocol): bot = make_bot(protocol) bot.kick(who='firemark', why='dunno lol') assert protocol.messages == [Message('KICK', '#czarnobyl', 'firemark', ':dunno lol')]
def test_notice(protocol): bot = make_bot(protocol) bot.notice('foobar') assert protocol.messages == [Message('NOTICE', 'socek', ':foobar')]