# 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_ping(protocol):
    execute_message(protocol, ['PING', 'foobar'])
    assert protocol.messages == [Message('PONG', 'foobar')]


def test_pong(protocol):

# 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_ping.py
from grazyna.tests.commands.base import execute_message
from grazyna.test_mocks.sender import Message



def test_ping(protocol):
    execute_message(protocol, ['PING', 'foobar'])
    assert protocol.messages == [Message('PONG', 'foobar')]


def test_pong(protocol):

    execute_message(protocol, ['PONG', 'foobar'])