Example #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)
Example #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)
Example #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)
Example #4
0
def test_not_match(command):
    assert not match(command, None)
Example #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
Example #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)
Example #7
0
def test_not_match(command):
    assert not match(command, None)
Example #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
Example #9
0
def test_match(command):
    assert match(command)
Example #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)
Example #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)
Example #12
0
def test_match(command):
    assert match(command)