# Path: thefuck/entrypoints/alias.py
# def _get_alias(known_args):
#     if six.PY2:
#         warn("The Fuck will drop Python 2 support soon, more details "
#              "https://github.com/nvbn/thefuck/issues/685")
# 
#     alias = shell.app_alias(known_args.alias)
# 
#     if known_args.enable_experimental_instant_mode:
#         if six.PY2:
#             warn("Instant mode requires Python 3")
#         elif not which('script'):
#             warn("Instant mode requires `script` app")
#         else:
#             return shell.instant_mode_alias(known_args.alias)
# 
#     return alias
# 
# def print_alias(known_args):
#     settings.init(known_args)
#     print(_get_alias(known_args))


from mock import Mock
from thefuck.entrypoints.alias import _get_alias, print_alias
import pytest
    'py2, enable_experimental_instant_mode, which, is_instant', [
        (False, True, True, True),
        (False, False, True, False),
        (False, True, False, False),
        (True, True, True, False),
        (True, True, False, False),
        (True, False, True, False)])
def test_get_alias(monkeypatch, mocker, py2,
                   enable_experimental_instant_mode,
                   which, is_instant):
    monkeypatch.setattr('six.PY2', py2)
    args = Mock(
        enable_experimental_instant_mode=enable_experimental_instant_mode,
        alias='fuck', )
    mocker.patch('thefuck.entrypoints.alias.which', return_value=which)
    shell = Mock(app_alias=lambda _: 'app_alias',
                 instant_mode_alias=lambda _: 'instant_mode_alias')
    monkeypatch.setattr('thefuck.entrypoints.alias.shell', shell)

    alias = _get_alias(args)
    if is_instant:
        assert alias == 'instant_mode_alias'
    else:
        assert alias == 'app_alias'


def test_print_alias(mocker):
    settings_mock = mocker.patch('thefuck.entrypoints.alias.settings')
    _get_alias_mock = mocker.patch('thefuck.entrypoints.alias._get_alias')
    known_args = Mock()

# Path: thefuck/entrypoints/alias.py
# def _get_alias(known_args):
#     if six.PY2:
#         warn("The Fuck will drop Python 2 support soon, more details "
#              "https://github.com/nvbn/thefuck/issues/685")
# 
#     alias = shell.app_alias(known_args.alias)
# 
#     if known_args.enable_experimental_instant_mode:
#         if six.PY2:
#             warn("Instant mode requires Python 3")
#         elif not which('script'):
#             warn("Instant mode requires `script` app")
#         else:
#             return shell.instant_mode_alias(known_args.alias)
# 
#     return alias
# 
# def print_alias(known_args):
#     settings.init(known_args)
#     print(_get_alias(known_args))


# Path: tests/entrypoints/test_alias.py
from mock import Mock
from thefuck.entrypoints.alias import _get_alias, print_alias
import pytest

    'py2, enable_experimental_instant_mode, which, is_instant', [
        (False, True, True, True),
        (False, False, True, False),
        (False, True, False, False),
        (True, True, True, False),
        (True, True, False, False),
        (True, False, True, False)])
def test_get_alias(monkeypatch, mocker, py2,
                   enable_experimental_instant_mode,
                   which, is_instant):
    monkeypatch.setattr('six.PY2', py2)
    args = Mock(
        enable_experimental_instant_mode=enable_experimental_instant_mode,
        alias='fuck', )
    mocker.patch('thefuck.entrypoints.alias.which', return_value=which)
    shell = Mock(app_alias=lambda _: 'app_alias',
                 instant_mode_alias=lambda _: 'instant_mode_alias')
    monkeypatch.setattr('thefuck.entrypoints.alias.shell', shell)

    alias = _get_alias(args)
    if is_instant:
        assert alias == 'instant_mode_alias'
    else:
        assert alias == 'app_alias'


def test_print_alias(mocker):
    settings_mock = mocker.patch('thefuck.entrypoints.alias.settings')
    _get_alias_mock = mocker.patch('thefuck.entrypoints.alias._get_alias')
    known_args = Mock()

    print_alias(known_args)