# Path: grazyna/tests/commands/base.py
# def execute_message(protocol, data):
#     ctrl = MessageController(protocol, data)
#     ctrl.log = Mock()
#     ctrl.execute_message()
#     return ctrl
# 
# Path: grazyna/test_mocks/sender.py
# class Message(list):
# 
#     def __init__(self, *args):
#         arg, *args = args
#         super().__init__([arg.upper()] + args)


from grazyna.tests.commands.base import execute_message
from grazyna.test_mocks.sender import Message


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_kick_another_person(protocol):
    protocol.config['main']['nick'] = 'firemark'
    data = [':socek!a@b', 'KICK', '#czarnobyl', 'dimmur']

# Path: grazyna/tests/commands/base.py
# def execute_message(protocol, data):
#     ctrl = MessageController(protocol, data)
#     ctrl.log = Mock()
#     ctrl.execute_message()
#     return ctrl
# 
# Path: grazyna/test_mocks/sender.py
# class Message(list):
# 
#     def __init__(self, *args):
#         arg, *args = args
#         super().__init__([arg.upper()] + args)


# Path: grazyna/tests/commands/test_command_kick.py
from grazyna.tests.commands.base import execute_message
from grazyna.test_mocks.sender import Message



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_kick_another_person(protocol):
    protocol.config['main']['nick'] = 'firemark'
    data = [':socek!a@b', 'KICK', '#czarnobyl', 'dimmur']

    ctrl = execute_message(protocol, data)