# 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/irc/models.py
# class WhoisFuture(asyncio.Future):
#     data = None
# 
#     def __init__(self, *args, **kwargs):
#         super().__init__(*args, **kwargs)
#         self.data = WhoisData()


from grazyna.tests.commands.base import execute_message
from grazyna.irc.models import WhoisFuture
    assert future.data.ircname == 'the socketor'
    assert future.data.host == 'onet.pl'
    assert future.data.realname == 'realsocek'


def test_whois_user_without_trigger(protocol):
    data = [
        ':server', '311', 'bot',
        'socek', 'realsocek', 'onet.pl', '*', 'the socketor',
    ]
    execute_message(protocol, data)
    assert 'socek' not in protocol.whois_heap


def test_whois_server(protocol):
    data = [':server', '312', 'bot', 'socek', 'banana server']
    future = protocol.whois_heap['socek'] = WhoisFuture()
    execute_message(protocol, data)
    assert future.data.server == 'banana server'


def test_whois_idle(protocol):
    data = [':server', '317', 'bot', 'socek', '30', 'seconds idle']
    future = protocol.whois_heap['socek'] = WhoisFuture()
    execute_message(protocol, data)
    assert future.data.idle == 30


def test_whois_channels(protocol):
    data = [':server', '319', 'bot', 'socek', '#foo #bar']

# 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/irc/models.py
# class WhoisFuture(asyncio.Future):
#     data = None
# 
#     def __init__(self, *args, **kwargs):
#         super().__init__(*args, **kwargs)
#         self.data = WhoisData()


# Path: grazyna/tests/commands/test_command_whois.py
from grazyna.tests.commands.base import execute_message
from grazyna.irc.models import WhoisFuture

    assert future.data.ircname == 'the socketor'
    assert future.data.host == 'onet.pl'
    assert future.data.realname == 'realsocek'


def test_whois_user_without_trigger(protocol):
    data = [
        ':server', '311', 'bot',
        'socek', 'realsocek', 'onet.pl', '*', 'the socketor',
    ]
    execute_message(protocol, data)
    assert 'socek' not in protocol.whois_heap


def test_whois_server(protocol):
    data = [':server', '312', 'bot', 'socek', 'banana server']
    future = protocol.whois_heap['socek'] = WhoisFuture()
    execute_message(protocol, data)
    assert future.data.server == 'banana server'


def test_whois_idle(protocol):
    data = [':server', '317', 'bot', 'socek', '30', 'seconds idle']
    future = protocol.whois_heap['socek'] = WhoisFuture()
    execute_message(protocol, data)
    assert future.data.idle == 30


def test_whois_channels(protocol):
    data = [':server', '319', 'bot', 'socek', '#foo #bar']

    future = protocol.whois_heap['socek'] = WhoisFuture()