コード例 #1
0
def test_get_new_command(command_found):
    with patch('thefuck.rules.no_command._get_output',
               return_value=command_found.decode()):
        assert get_new_command(Command('aptget install vim', '', ''), settings)\
            == 'apt-get install vim'
        assert get_new_command(Command('sudo aptget install vim', '', ''), settings) \
            == 'sudo apt-get install vim'
コード例 #2
0
def test_get_new_command(command_found):
    with patch('thefuck.rules.no_command._get_output',
               return_value=command_found.decode()):
        assert get_new_command(Command('aptget install vim', '', ''), settings)\
            == 'apt-get install vim'
        assert get_new_command(Command('sudo aptget install vim', '', ''), settings) \
            == 'sudo apt-get install vim'
コード例 #3
0
ファイル: test_no_command.py プロジェクト: Howard9891/thefuck
def test_get_new_command():
    assert get_new_command(
        Command(stderr='vom: not found',
                script='vom file.py')) == ['vim file.py']
    assert get_new_command(
        Command(stderr='fucck: not found',
                script='fucck')) == ['fsck']
コード例 #4
0
ファイル: test_no_command.py プロジェクト: ltype/thefuck
def test_get_new_command(*args):
    assert get_new_command(
        Command(stderr='vom: not found',
                script='vom file.py'),
        None) == 'vim file.py'
    assert get_new_command(
        Command(stderr='fucck: not found',
                script='fucck'),
        Command) == 'fsck'
コード例 #5
0
ファイル: test_no_command.py プロジェクト: tiandee/thefuck
def test_get_new_command():
    with patch('thefuck.rules.no_command._get_all_callables',
               return_value=['vim', 'apt-get']):
        assert get_new_command(
            Mock(stderr='vom: not found',
                 script='vom file.py'),
            None) == 'vim file.py'
コード例 #6
0
ファイル: test_no_command.py プロジェクト: Googulator/thefuck
def test_get_new_command(script, result):
    assert get_new_command(Command(script)) == result
コード例 #7
0
def test_get_new_command(script, result):
    assert get_new_command(Command(script, "")) == result
コード例 #8
0
def test_get_new_command():
    assert get_new_command(
        Command(stderr='vom: not found',
                script='vom file.py')) == ['vim file.py']
    assert get_new_command(Command(stderr='fucck: not found',
                                   script='fucck')) == ['fsck']
コード例 #9
0
ファイル: test_no_command.py プロジェクト: marwensaid/thefuck
def test_get_new_command(*args):
    assert get_new_command(Mock(stderr='vom: not found', script='vom file.py'),
                           None) == 'vim file.py'
    assert get_new_command(Mock(stderr='fucck: not found', script='fucck'),
                           None) == 'fsck'