Exemplo n.º 1
0
def test_not_match(mocker, command, packages, which):
    mocker.patch("thefuck.rules.apt_get.which", return_value=which)
    mocker.patch("thefuck.rules.apt_get._get_packages",
                 create=True,
                 return_value=packages)

    assert not match(command)
Exemplo n.º 2
0
def test_not_match(mocker, command, packages, which):
    mocker.patch('thefuck.rules.apt_get.which', return_value=which)
    mock = mocker.patch('thefuck.rules.apt_get.command_not_found',
                        create=True)
    mock.getPackages.return_value = packages

    assert not match(command)
Exemplo n.º 3
0
def test_match(mocker, command, packages):
    mocker.patch('thefuck.rules.apt_get.which', return_value=None)
    mocker.patch('thefuck.rules.apt_get._get_packages',
                 create=True,
                 return_value=packages)

    assert match(command)
Exemplo n.º 4
0
def test_not_match(command):
    assert not match(command, None)
Exemplo n.º 5
0
def test_match_mocked(cmdnf_mock, command, return_value):
    get_packages = Mock(return_value=return_value)
    cmdnf_mock.CommandNotFound.return_value = Mock(getPackages=get_packages)
    assert match(command, None)
    assert cmdnf_mock.CommandNotFound.called
    assert get_packages.called
Exemplo n.º 6
0
def test_not_match(mocker, command, packages, which):
    mocker.patch('thefuck.rules.apt_get.which', return_value=which)
    mock = mocker.patch('thefuck.rules.apt_get.command_not_found', create=True)
    mock.getPackages.return_value = packages

    assert not match(command)
Exemplo n.º 7
0
def test_not_match(command):
    assert not match(command, None)
Exemplo n.º 8
0
def test_match_mocked(cmdnf_mock, command, return_value):
    get_packages = Mock(return_value=return_value)
    cmdnf_mock.CommandNotFound.return_value = Mock(getPackages=get_packages)
    assert match(command, None)
    assert cmdnf_mock.CommandNotFound.called
    assert get_packages.called
Exemplo n.º 9
0
def test_match(command):
    assert match(command)
Exemplo n.º 10
0
def test_not_match_mocked(cmdnf_mock, command, return_value):
    get_packages = Mock(return_value=return_value)
    cmdnf_mock.CommandNotFound.return_value = Mock(getPackages=get_packages)
    assert not match(command)
Exemplo n.º 11
0
def test_not_match_mocked(cmdnf_mock, command, return_value):
    get_packages = Mock(return_value=return_value)
    cmdnf_mock.CommandNotFound.return_value = Mock(getPackages=get_packages)
    assert not match(command)
Exemplo n.º 12
0
def test_match(command):
    assert match(command)