repo_id
stringclasses
400 values
commit_sha
stringclasses
400 values
commit_index
int32
0
951
in_repo_split
stringclasses
1 value
cross_repo_split
stringclasses
1 value
test_file
stringlengths
7
121
test_function
stringlengths
1
108
assertion_type
stringclasses
32 values
difficulty
stringclasses
8 values
context_lines
int32
3
600
prefix
large_stringlengths
44
113k
target
large_stringlengths
1
498
anchor_sha
stringclasses
400 values
anchor_index
int32
0
951
qna_source
stringclasses
1 value
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_zsh.py
test_and_
assert
string_literal
19
import os import pytest from thefuck.shells.zsh import Zsh class TestZsh(object): def shell(self): return Zsh() def shell_aliases(self): os.environ['TF_SHELL_ALIASES'] = ( 'fuck=\'eval $(thefuck $(fc -ln -1 | tail -n 1))\'\n' 'l=\'ls -CF\'\n' 'la=\'ls -A\'\...
'ls && cd'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_zsh.py
test_or_
assert
string_literal
19
import os import pytest from thefuck.shells.zsh import Zsh class TestZsh(object): def shell(self): return Zsh() def shell_aliases(self): os.environ['TF_SHELL_ALIASES'] = ( 'fuck=\'eval $(thefuck $(fc -ln -1 | tail -n 1))\'\n' 'l=\'ls -CF\'\n' 'la=\'ls -A\'\...
'ls || cd'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/entrypoints/test_alias.py
test_get_alias
assert
string_literal
30
from mock import Mock import pytest from thefuck.entrypoints.alias import _get_alias @pytest.mark.parametrize( 'py2, enable_experimental_instant_mode, which, is_instant', [ (False, True, True, True), (False, False, True, False), (False, True, False, False), (True, True, True, False)...
'app_alias'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_cp_omitting_directory.py
test_get_new_command
assert
string_literal
7
import pytest from thefuck.rules.cp_omitting_directory import match, get_new_command from thefuck.types import Command def test_get_new_command(): assert get_new_command(Command('cp dir', '')) ==
'cp -a dir'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_zsh.py
test_info
assert
string_literal
21
import os import pytest from thefuck.shells.zsh import Zsh class TestZsh(object): def shell(self): return Zsh() def shell_aliases(self): os.environ['TF_SHELL_ALIASES'] = ( 'fuck=\'eval $(thefuck $(fc -ln -1 | tail -n 1))\'\n' 'l=\'ls -CF\'\n' 'la=\'ls -A\'\...
'ZSH 3.5.9'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_utils.py
test_with_filled_cache
assert
string_literal
61
import pytest import warnings from mock import Mock, patch from thefuck.utils import default_settings, \ memoize, get_closest, get_all_executables, replace_argument, \ get_all_matched_commands, is_app, for_app, cache, \ get_valid_history_without_current, _cache, get_close_matches from thefuck.types import C...
'new-value'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_bash.py
test_info
assert
string_literal
21
import os import pytest from thefuck.shells import Bash class TestBash(object): def shell(self): return Bash() def shell_aliases(self): os.environ['TF_SHELL_ALIASES'] = ( 'alias fuck=\'eval $(thefuck $(fc -ln -1))\'\n' 'alias l=\'ls -CF\'\n' 'alias la=\'ls ...
'Bash 3.5.9'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_apt_upgrade.py
test_get_new_command
assert
string_literal
20
import pytest from thefuck.rules.apt_upgrade import get_new_command, match from thefuck.types import Command match_output = ''' Listing... Done heroku/stable 6.15.2-1 amd64 [upgradable from: 6.14.43-1] resolvconf/zesty-updates,zesty-updates 1.79ubuntu4.1 all [upgradable from: 1.79ubuntu4] squashfs-tools/zesty-updates ...
'apt upgrade'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_pip_unknown_command.py
test_get_new_command
assert
string_literal
13
import pytest from thefuck.rules.pip_unknown_command import match, get_new_command from thefuck.types import Command def pip_unknown_cmd(): return '''ERROR: unknown command "instatl" - maybe you meant "install"''' def pip_unknown_cmd_without_recommend(): return '''ERROR: unknown command "i"''' def test_get_n...
'pip install'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_fish.py
test_or_
assert
string_literal
20
import pytest from thefuck.shells import Fish class TestFish(object): def shell(self): return Fish() def Popen(self, mocker): mock = mocker.patch('thefuck.shells.fish.Popen') mock.return_value.stdout.read.side_effect = [( b'cd\nfish_config\nfuck\nfunced\nfuncsave\ngrep\nhi...
'foo; or bar'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_fish.py
test_and_
assert
string_literal
20
import pytest from thefuck.shells import Fish class TestFish(object): def shell(self): return Fish() def Popen(self, mocker): mock = mocker.patch('thefuck.shells.fish.Popen') mock.return_value.stdout.read.side_effect = [( b'cd\nfish_config\nfuck\nfunced\nfuncsave\ngrep\nhi...
'foo; and bar'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_has_exists_script.py
test_get_new_command
assert
string_literal
7
from mock import patch from thefuck.rules.has_exists_script import match, get_new_command from thefuck.types import Command def test_get_new_command(): assert get_new_command(Command('main --help', '')) ==
'./main --help'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_ssh_known_host.py
test_get_new_command
assert
string_literal
44
import os import pytest from thefuck.rules.ssh_known_hosts import match, get_new_command,\ side_effect from thefuck.types import Command def ssh_error(tmpdir): path = os.path.join(str(tmpdir), 'known_hosts') def reset(path): with open(path, 'w') as fh: lines = [ '123.23...
'ssh user@host'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_grep_recursive.py
test_get_new_command
assert
string_literal
6
from thefuck.rules.grep_recursive import match, get_new_command from thefuck.types import Command def test_get_new_command(): assert get_new_command(Command('grep blah .', '')) ==
'grep -r blah .'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_powershell.py
test_and_
assert
string_literal
11
import pytest from thefuck.shells import Powershell class TestPowershell(object): def shell(self): return Powershell() def test_and_(self, shell): assert shell.and_('ls', 'cd') ==
'(ls) -and (cd)'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_composer_not_command.py
test_get_new_command
assert
string_literal
39
import pytest from thefuck.rules.composer_not_command import match, get_new_command from thefuck.types import Command def composer_not_command(): # that weird spacing is part of the actual command output return ( '\n' '\n' ' \n' ' [InvalidArgu...
'composer update'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_ls_all.py
test_get_new_command
assert
string_literal
6
from thefuck.rules.ls_all import match, get_new_command from thefuck.types import Command def test_get_new_command(): assert get_new_command(Command('ls empty_dir', '')) ==
'ls -A empty_dir'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_ls_lah.py
test_get_new_command
assert
string_literal
6
from thefuck.rules.ls_lah import match, get_new_command from thefuck.types import Command def test_get_new_command(): assert get_new_command(Command('ls file.py', '')) ==
'ls -lah file.py'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_apt_upgrade.py
test_get_new_command
assert
string_literal
23
import pytest from thefuck.rules.apt_upgrade import get_new_command, match from thefuck.types import Command match_output = ''' Listing... Done heroku/stable 6.15.2-1 amd64 [upgradable from: 6.14.43-1] resolvconf/zesty-updates,zesty-updates 1.79ubuntu4.1 all [upgradable from: 1.79ubuntu4] squashfs-tools/zesty-updates ...
'sudo apt upgrade'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_brew_install.py
test_get_new_command
assert
string_literal
26
import pytest from thefuck.rules.brew_install import match, get_new_command from thefuck.rules.brew_install import _get_formulas from thefuck.types import Command def brew_no_available_formula(): return '''Error: No available formula for elsticsearch ''' def brew_install_no_argument(): return '''This command ...
'brew install aha'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_sed_unterminated_s.py
test_get_new_command
assert
string_literal
12
import pytest from thefuck.rules.sed_unterminated_s import match, get_new_command from thefuck.types import Command def sed_unterminated_s(): return "sed: -e expression #1, char 9: unterminated `s' command" def test_get_new_command(sed_unterminated_s): assert (get_new_command(Command('sed -e s/foo/bar', sed_u...
'sed -es/foo/bar/'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_fish.py
test_info
assert
string_literal
21
import pytest from thefuck.shells import Fish class TestFish(object): def shell(self): return Fish() def Popen(self, mocker): mock = mocker.patch('thefuck.shells.fish.Popen') mock.return_value.stdout.read.side_effect = [( b'cd\nfish_config\nfuck\nfunced\nfuncsave\ngrep\nhi...
'Fish Shell 3.5.9'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_fix_alt_space.py
test_get_new_command
assert
string_literal
7
from thefuck.rules.fix_alt_space import match, get_new_command from thefuck.types import Command def test_get_new_command(): """ Replace the Alt+Space character by a simple space """ assert (get
'ps -ef | grep foo'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_git_rebase_no_changes.py
test_get_new_command
assert
string_literal
19
import pytest from thefuck.rules.git_rebase_no_changes import match, get_new_command from thefuck.types import Command def output(): return '''Applying: Test commit No changes - did you forget to use 'git add'? If there is nothing left to stage, chances are that something else already introduced the same changes; ...
'git rebase --skip'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_sed_unterminated_s.py
test_get_new_command
assert
string_literal
10
import pytest from thefuck.rules.sed_unterminated_s import match, get_new_command from thefuck.types import Command def sed_unterminated_s(): return "sed: -e expression #1, char 9: unterminated `s' command" def test_get_new_command(sed_unterminated_s): assert (get
'sed -e s/foo/bar/'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_types.py
test_isnt_match_when_rule_failed
assert
string_literal
19
import os from subprocess import PIPE, STDOUT from mock import Mock import pytest from tests.utils import CorrectedCommand, Rule from thefuck import const from thefuck.exceptions import EmptyCommand from thefuck.system import Path from thefuck.types import Command class TestRule(object): @pytest.mark.usefixtures(...
'[WARN] Rule test:'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/entrypoints/test_alias.py
test_get_alias
assert
string_literal
28
from mock import Mock import pytest from thefuck.entrypoints.alias import _get_alias @pytest.mark.parametrize( 'py2, enable_experimental_instant_mode, which, is_instant', [ (False, True, True, True), (False, False, True, False), (False, True, False, False), (True, True, True, False)...
'instant_mode_alias'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_git_commit_amend.py
test_get_new_command
assert
string_literal
10
import pytest from thefuck.rules.git_commit_amend import match, get_new_command from thefuck.types import Command @pytest.mark.parametrize('script', [ ('git commit -m "test commit"'), ('git commit')]) def test_get_new_command(script): assert get_new_command(Command(script, '')) ==
'git commit --amend'
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_generic.py
test_get_aliases
assert
collection
11
import pytest from thefuck.shells import Generic class TestGeneric(object): def shell(self): return Generic() def test_get_aliases(self, shell): assert shell.get_aliases() ==
{}
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_generic.py
test_get_history
assert
collection
14
import pytest from thefuck.shells import Generic class TestGeneric(object): def shell(self): return Generic() def test_get_history(self, history_lines, shell): history_lines(['ls', 'rm']) # We don't know what to do in generic shell with history lines, # so just ignore them: ...
[]
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_utils.py
test_with_blank_cache
assert
collection
59
import pytest import warnings from mock import Mock, patch from thefuck.utils import default_settings, \ memoize, get_closest, get_all_executables, replace_argument, \ get_all_matched_commands, is_app, for_app, cache, \ get_valid_history_without_current, _cache, get_close_matches from thefuck.types import C...
{}
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_dirty_untar.py
fixture
assert
collection
30
import os import pytest import tarfile from thefuck.rules.dirty_untar import match, get_new_command, side_effect, \ tar_extensions # noqa: E126 from thefuck.types import Command def fixture(filename): path = os.path.join(str(tmpdir), filename) def reset(path)...
{'e'}
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_dirty_unzip.py
zip_error_inner
assert
collection
30
import os import pytest import zipfile from thefuck.rules.dirty_unzip import match, get_new_command, side_effect from thefuck.types import Command from unicodedata import normalize def zip_error_inner(filename): path = os.path.join(str(tmpdir), filename) def reset(path): with zipfile.Z...
{'e'}
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/entrypoints/test_fix_command.py
test_from_command_argument
assert
collection
12
import pytest from mock import Mock from thefuck.entrypoints.fix_command import _get_raw_command class TestGetRawCommand(object): def test_from_command_argument(self, os_environ): os_environ['TF_HISTORY'] = None known_args = Mock(force_command=None, command=['sl']) ...
['sl']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_generic.py
test_split_command
assert
collection
11
import pytest from thefuck.shells import Generic class TestGeneric(object): def shell(self): return Generic() def test_split_command(self, shell): assert shell.split_command('ls') ==
['ls']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_conf.py
test_from_file
assert
collection
25
import pytest import six import os from mock import Mock from thefuck import const def load_source(mocker): return mocker.patch('thefuck.conf.load_source') class TestSettingsFromFile(object): def test_from_file(self, load_source, settings): load_source.return_value = Mock(rules=['test'], ...
['git']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/entrypoints/test_fix_command.py
test_from_history
assert
collection
17
import pytest from mock import Mock from thefuck.entrypoints.fix_command import _get_raw_command class TestGetRawCommand(object): @pytest.mark.parametrize('history, result', [ ('git br', 'git br'), ('git br\nfcuk', 'git br'), ('git br\nfcuk\nls', 'ls'), ('git br\nfcuk\nls\nfuk', 'l...
[result]
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_conf.py
test_from_file
assert
collection
20
import pytest import six import os from mock import Mock from thefuck import const def load_source(mocker): return mocker.patch('thefuck.conf.load_source') class TestSettingsFromFile(object): def test_from_file(self, load_source, settings): load_source.return_value = Mock(rules=['test'], ...
['test']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_bash.py
test_get_history
assert
collection
20
import os import pytest from thefuck.shells import Bash class TestBash(object): def shell(self): return Bash() def shell_aliases(self): os.environ['TF_SHELL_ALIASES'] = ( 'alias fuck=\'eval $(thefuck $(fc -ln -1))\'\n' 'alias l=\'ls -CF\'\n' 'alias la=\'ls ...
['ls', 'rm']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_fish.py
test_get_history
assert
collection
22
import pytest from thefuck.shells import Fish class TestFish(object): def shell(self): return Fish() def Popen(self, mocker): mock = mocker.patch('thefuck.shells.fish.Popen') mock.return_value.stdout.read.side_effect = [( b'cd\nfish_config\nfuck\nfunced\nfuncsave\ngrep\nhi...
['ls', 'rm']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_tcsh.py
test_get_history
assert
collection
21
import pytest from thefuck.shells.tcsh import Tcsh class TestTcsh(object): def shell(self): return Tcsh() def Popen(self, mocker): mock = mocker.patch('thefuck.shells.tcsh.Popen') mock.return_value.stdout.read.return_value = ( b'fuck\teval $(thefuck $(fc -ln -1))\n' ...
['ls', 'rm']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_zsh.py
test_get_history
assert
collection
20
import os import pytest from thefuck.shells.zsh import Zsh class TestZsh(object): def shell(self): return Zsh() def shell_aliases(self): os.environ['TF_SHELL_ALIASES'] = ( 'fuck=\'eval $(thefuck $(fc -ln -1 | tail -n 1))\'\n' 'l=\'ls -CF\'\n' 'la=\'ls -A\'\...
['ls', 'rm']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_logs.py
test_debug
assert
collection
12
import pytest from thefuck import logs @pytest.mark.usefixtures('no_colors') @pytest.mark.parametrize('debug, stderr', [ (True, 'DEBUG: test\n'), (False, '')]) def test_debug(capsys, settings, debug, stderr): settings.debug = debug logs.debug('test') assert capsys.readouterr() ==
('', stderr)
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_ui.py
test_with_confirmation_select_second
assert
collection
32
import pytest from itertools import islice from thefuck import ui from thefuck.types import CorrectedCommand from thefuck import const def patch_get_key(monkeypatch): def patch(vals): vals = iter(vals) monkeypatch.setattr('thefuck.ui.get_key', lambda: next(vals)) return patch class TestSelect...
('', stderr)
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_git_not_command.py
test_get_new_command
assert
collection
37
import pytest from thefuck.rules.git_not_command import match, get_new_command from thefuck.types import Command def git_not_command(): return """git: 'brnch' is not a git command. See 'git --help'. The most similar command is branch """ def git_not_command_one_of_this(): return """git: 'st' is not a git com...
['git branch']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_dirty_unzip.py
test_side_effect
assert
collection
47
import os import pytest import zipfile from thefuck.rules.dirty_unzip import match, get_new_command, side_effect from thefuck.types import Command from unicodedata import normalize def zip_error(tmpdir): def zip_error_inner(filename): path = os.path.join(str(tmpdir), filename) def reset(path): ...
{filename, 'd'}
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/entrypoints/test_fix_command.py
test_from_force_command_argument
assert
collection
9
import pytest from mock import Mock from thefuck.entrypoints.fix_command import _get_raw_command class TestGetRawCommand(object): def test_from_force_command_argument(self): known_args = Mock(force_command=['git', 'brunch']) assert _get_raw_command(known_args) ==
['git', 'brunch']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_generic.py
test_split_command
assert
collection
12
import pytest from thefuck.shells import Generic class TestGeneric(object): def shell(self): return Generic() def test_split_command(self, shell): assert shell.split_command('ls') == ['ls'] assert shell.split_command(u'echo café') == [
[u'echo', u'café']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_git_not_command.py
test_get_new_command
assert
collection
41
import pytest from thefuck.rules.git_not_command import match, get_new_command from thefuck.types import Command def git_not_command(): return """git: 'brnch' is not a git command. See 'git --help'. The most similar command is branch """ def git_not_command_one_of_this(): return """git: 'st' is not a git com...
['git tag', 'git stage']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_types.py
test_hashable
assert
collection
15
import os from subprocess import PIPE, STDOUT from mock import Mock import pytest from tests.utils import CorrectedCommand, Rule from thefuck import const from thefuck.exceptions import EmptyCommand from thefuck.system import Path from thefuck.types import Command class TestCorrectedCommand(object): def test_hash...
{CorrectedCommand('ls')}
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_ui.py
test_without_commands
assert
collection
27
import pytest from itertools import islice from thefuck import ui from thefuck.types import CorrectedCommand from thefuck import const def patch_get_key(monkeypatch): def patch(vals): vals = iter(vals) monkeypatch.setattr('thefuck.ui.get_key', lambda: next(vals)) return patch class TestSelect...
('', 'No fucks given\n')
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_dirty_untar.py
test_side_effect
assert
collection
41
import os import pytest import tarfile from thefuck.rules.dirty_untar import match, get_new_command, side_effect, \ tar_extensions # noqa: E126 from thefuck.types import Command def tar_error(tmpdir): def fixture(filename): path = os.path.join(str(tmpdir), filename) ...
{unquoted.format(ext), 'd'}
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_corrector.py
test_get_corrected_commands
assert
collection
18
import pytest from tests.utils import Rule, CorrectedCommand from thefuck import corrector, const from thefuck.system import Path from thefuck.types import Command from thefuck.corrector import get_corrected_commands, organize_commands def test_get_corrected_commands(mocker): command = Command('test', 'test') ...
['test!', 'test@', 'test;']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_dirty_untar.py
fixture
assert
collection
29
import os import pytest import tarfile from thefuck.rules.dirty_untar import match, get_new_command, side_effect, \ tar_extensions # noqa: E126 from thefuck.types import Command def fixture(filename): path = os.path.join(str(tmpdir), filename) def reset(path)...
{filename, 'a', 'b', 'c', 'd'}
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_dirty_unzip.py
zip_error_inner
assert
collection
29
import os import pytest import zipfile from thefuck.rules.dirty_unzip import match, get_new_command, side_effect from thefuck.types import Command from unicodedata import normalize def zip_error_inner(filename): path = os.path.join(str(tmpdir), filename) def reset(path): with zipfile.Z...
{filename, 'a', 'b', 'c', 'd'}
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_gulp_not_task.py
test_get_new_command
assert
collection
17
import pytest from io import BytesIO from thefuck.types import Command from thefuck.rules.gulp_not_task import match, get_new_command def output(task): return '''[00:41:11] Using gulpfile gulpfile.js [00:41:11] Task '{}' is not in your gulpfile [00:41:11] Please check the documentation for proper gulpfile formatti...
['gulp serve', 'gulp default']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/specific/test_npm.py
test_get_scripts
assert
collection
26
from io import BytesIO import pytest from thefuck.specific.npm import get_scripts run_script_stdout = b''' Lifecycle scripts included in code-view-web: test jest available via `npm run-script`: build cp node_modules/ace-builds/src-min/ -a resources/ace/ && webpack --progress --colors -p --config ./webpac...
['build', 'develop', 'watch-test']
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_fish.py
test_get_aliases
assert
collection
33
import pytest from thefuck.shells import Fish class TestFish(object): def shell(self): return Fish() def Popen(self, mocker): mock = mocker.patch('thefuck.shells.fish.Popen') mock.return_value.stdout.read.side_effect = [( b'cd\nfish_config\nfuck\nfunced\nfuncsave\ngrep\nhi...
{'func1': 'func1', 'func2': 'func2'}
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_utils.py
test_with_blank_cache
assert
collection
61
import pytest import warnings from mock import Mock, patch from thefuck.utils import default_settings, \ memoize, get_closest, get_all_executables, replace_argument, \ get_all_matched_commands, is_app, for_app, cache, \ get_valid_history_without_current, _cache, get_close_matches from thefuck.types import C...
{key: {'etag': '0', 'value': 'test'}}
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_docker_not_command.py
test_get_new_command
assert
collection
115
import pytest from io import BytesIO from thefuck.types import Command from thefuck.rules.docker_not_command import get_new_command, match def docker_help(mocker): help = b'''Usage: docker [OPTIONS] COMMAND [arg...] A self-sufficient runtime for linux containers. Options: --api-cors-header= ...
['docker {}'.format(x) for x in fixed]
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_ui.py
test_without_confirmation
assert
collection
28
import pytest from itertools import islice from thefuck import ui from thefuck.types import CorrectedCommand from thefuck import const def patch_get_key(monkeypatch): def patch(vals): vals = iter(vals) monkeypatch.setattr('thefuck.ui.get_key', lambda: next(vals)) return patch class TestSelect...
('', const.USER_COMMAND_MARK + 'ls\n')
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/entrypoints/test_not_configured.py
_assert_tracker_updated
assert
variable
29
import pytest import json from six import StringIO from mock import MagicMock from thefuck.shells.generic import ShellConfiguration from thefuck.entrypoints.not_configured import main def usage_tracker(mocker): return mocker.patch( 'thefuck.entrypoints.not_configured._get_not_configured_usage_tracker_path'...
pid
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_conf.py
test_settings_defaults
assert
variable
15
import pytest import six import os from mock import Mock from thefuck import const def load_source(mocker): return mocker.patch('thefuck.conf.load_source') def test_settings_defaults(load_source, settings): load_source.return_value = object() settings.init() for key, val in const.DEFAULT_SETTINGS.item...
val
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/test_utils.py
test_default_settings
assert
variable
19
import pytest import warnings from mock import Mock, patch from thefuck.utils import default_settings, \ memoize, get_closest, get_all_executables, replace_argument, \ get_all_matched_commands, is_app, for_app, cache, \ get_valid_history_without_current, _cache, get_close_matches from thefuck.types import C...
new
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_brew_unknown_command.py
test_get_new_command
assert
variable
18
import pytest from thefuck.rules.brew_unknown_command import match, get_new_command from thefuck.rules.brew_unknown_command import _brew_commands from thefuck.types import Command def brew_unknown_cmd(): return '''Error: Unknown command: inst''' def brew_unknown_cmd2(): return '''Error: Unknown command: insta...
cmds
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_brew_cask_dependency.py
test_get_new_command
assert
variable
20
import pytest from thefuck.rules.brew_cask_dependency import match, get_new_command from thefuck.types import Command output = '''sshfs: OsxfuseRequirement unsatisfied! You can install with Homebrew-Cask: brew cask install osxfuse You can download from: https://osxfuse.github.io/ Error: An unsatisfied requiremen...
after
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_dirty_unzip.py
test_get_new_command
assert
variable
41
import os import pytest import zipfile from thefuck.rules.dirty_unzip import match, get_new_command, side_effect from thefuck.types import Command from unicodedata import normalize def zip_error(tmpdir): def zip_error_inner(filename): path = os.path.join(str(tmpdir), filename) def reset(path): ...
fixed
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_git_fix_stash.py
test_get_new_command
assert
variable
22
import pytest from thefuck.rules.git_fix_stash import match, get_new_command from thefuck.types import Command git_stash_err = ''' usage: git stash list [<options>] or: git stash show [<stash>] or: git stash drop [-q|--quiet] [<stash>] or: git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>] or: git ...
fixed
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_long_form_help.py
test_get_new_command
assert
variable
12
import pytest from thefuck.rules.long_form_help import match, get_new_command from thefuck.types import Command @pytest.mark.parametrize('before, after', [ ('grep -h', 'grep --help'), ('tar -h', 'tar --help'), ('docker run -h', 'docker run --help'), ('cut -h', 'cut --help')]) def test_get_new_command(b...
after
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_pacman_not_found.py
test_get_new_command
assert
variable
18
import pytest from mock import patch from thefuck.rules import pacman_not_found from thefuck.rules.pacman_not_found import match, get_new_command from thefuck.types import Command PKGFILE_OUTPUT_LLC = '''extra/llvm 3.6.0-5 /usr/bin/llc extra/llvm35 3.5.2-13/usr/bin/llc''' @pytest.mark.skipif(not getattr(pacman_n...
fixed
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_prove_recursively.py
test_get_new_command
assert
variable
18
import pytest from thefuck.rules.prove_recursively import match, get_new_command from thefuck.types import Command output = '''Files=0, Tests=0, 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU) Result: NOTESTS''' def isdir(mocker): return mocker.patch('thefuck.rules.prove_recursively' ...
after
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_sudo.py
test_get_new_command
assert
variable
12
import pytest from thefuck.rules.sudo import match, get_new_command from thefuck.types import Command @pytest.mark.parametrize('before, after', [ ('ls', 'sudo ls'), ('echo a > b', 'sudo sh -c "echo a > b"'), ('echo "a" >> b', 'sudo sh -c "echo \\"a\\" >> b"'), ('mkdir && touch a', 'sudo sh -c "mkdir &&...
after
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_unsudo.py
test_get_new_command
assert
variable
10
import pytest from thefuck.rules.unsudo import match, get_new_command from thefuck.types import Command @pytest.mark.parametrize('before, after', [ ('sudo ls', 'ls'), ('sudo pacaur -S helloworld', 'pacaur -S helloworld')]) def test_get_new_command(before, after): assert get_new_command(Command(before, '')...
after
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_bash.py
test_from_shell
assert
variable
24
import os import pytest from thefuck.shells import Bash class TestBash(object): def shell(self): return Bash() def shell_aliases(self): os.environ['TF_SHELL_ALIASES'] = ( 'alias fuck=\'eval $(thefuck $(fc -ln -1))\'\n' 'alias l=\'ls -CF\'\n' 'alias la=\'ls ...
after
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_bash.py
test_app_alias_variables_correctly_set
assert
variable
20
import os import pytest from thefuck.shells import Bash class TestBash(object): def shell(self): return Bash() def shell_aliases(self): os.environ['TF_SHELL_ALIASES'] = ( 'alias fuck=\'eval $(thefuck $(fc -ln -1))\'\n' 'alias l=\'ls -CF\'\n' 'alias la=\'ls ...
alias
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_fish.py
test_from_shell
assert
variable
35
import pytest from thefuck.shells import Fish class TestFish(object): def shell(self): return Fish() def Popen(self, mocker): mock = mocker.patch('thefuck.shells.fish.Popen') mock.return_value.stdout.read.side_effect = [( b'cd\nfish_config\nfuck\nfunced\nfuncsave\ngrep\nhi...
after
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_tcsh.py
test_from_shell
assert
variable
25
import pytest from thefuck.shells.tcsh import Tcsh class TestTcsh(object): def shell(self): return Tcsh() def Popen(self, mocker): mock = mocker.patch('thefuck.shells.tcsh.Popen') mock.return_value.stdout.read.return_value = ( b'fuck\teval $(thefuck $(fc -ln -1))\n' ...
after
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_zsh.py
test_from_shell
assert
variable
23
import os import pytest from thefuck.shells.zsh import Zsh class TestZsh(object): def shell(self): return Zsh() def shell_aliases(self): os.environ['TF_SHELL_ALIASES'] = ( 'fuck=\'eval $(thefuck $(fc -ln -1 | tail -n 1))\'\n' 'l=\'ls -CF\'\n' 'la=\'ls -A\'\...
after
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/shells/test_zsh.py
test_app_alias_variables_correctly_set
assert
variable
20
import os import pytest from thefuck.shells.zsh import Zsh class TestZsh(object): def shell(self): return Zsh() def shell_aliases(self): os.environ['TF_SHELL_ALIASES'] = ( 'fuck=\'eval $(thefuck $(fc -ln -1 | tail -n 1))\'\n' 'l=\'ls -CF\'\n' 'la=\'ls -A\'\...
alias
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_apt_invalid_operation.py
test_get_new_command
assert
variable
96
from io import BytesIO import pytest from thefuck.types import Command from thefuck.rules.apt_invalid_operation import match, get_new_command, \ _get_operations invalid_operation = 'E: Invalid operation {}'.format apt_help = b'''apt 1.0.10.2ubuntu1 for amd64 compiled on Oct 5 2015 15:55:05 Usage: apt [options] co...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_aws_cli.py
test_get_new_command
assert
variable
84
import pytest from thefuck.rules.aws_cli import match, get_new_command from thefuck.types import Command no_suggestions = '''\ usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help aws: error: argum...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_az_cli.py
test_get_new_command
assert
variable
31
import pytest from thefuck.rules.az_cli import match, get_new_command from thefuck.types import Command no_suggestions = '''\ az provider: error: the following arguments are required: _subcommand usage: az provider [-h] {list,show,register,unregister,operation} ... ''' misspelled_command = '''\ az: 'providers' is no...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_chmod_x.py
test_get_new_command
assert
variable
16
import pytest from thefuck.types import Command from thefuck.rules.chmod_x import match, get_new_command def file_exists(mocker): return mocker.patch('os.path.exists', return_value=True) def file_access(mocker): return mocker.patch('os.access', return_value=False) @pytest.mark.parametrize('script, result', [...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_fab_command_not_found.py
test_get_new_command
assert
variable
33
import pytest from thefuck.rules.fab_command_not_found import match, get_new_command from thefuck.types import Command output = ''' Warning: Command(s) not found: extenson deloyp Available commands: update_config prepare_extension Template A string class for supporting $-substitutio...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_gem_unknown_command.py
test_get_new_command
assert
variable
66
import pytest from six import BytesIO from thefuck.rules.gem_unknown_command import match, get_new_command from thefuck.types import Command output = ''' ERROR: While executing gem ... (Gem::CommandLineError) Unknown command {} ''' gem_help_commands_stdout = b''' GEM commands are: build Build a ...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_git_flag_after_filename.py
test_get_new_command
assert
variable
27
import pytest from thefuck.rules.git_flag_after_filename import match, get_new_command from thefuck.types import Command command1 = Command('git log README.md -p', "fatal: bad flag '-p' used after filename") command2 = Command('git log README.md -p CONTRIBUTING.md', "fatal: bad fl...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_git_pull_clone.py
test_get_new_command
assert
variable
14
import pytest from thefuck.rules.git_pull_clone import match, get_new_command from thefuck.types import Command git_err = ''' fatal: Not a git repository (or any parent up to mount point /home) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). ''' @pytest.mark.parametrize('command, output', [...
output
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_git_push_force.py
test_get_new_command
assert
variable
32
import pytest from thefuck.rules.git_push_force import match, get_new_command from thefuck.types import Command git_err = ''' To /tmp/foo ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to '/tmp/bar' hint: Updates were rejected because the tip of your current branch is behind...
output
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_git_push_pull.py
test_get_new_command
assert
variable
50
import pytest from thefuck.rules.git_push_pull import match, get_new_command from thefuck.types import Command git_err = ''' To /tmp/foo ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to '/tmp/bar' hint: Updates were rejected because the tip of your current branch is behind ...
output
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_git_push_without_commits.py
test_get_new_command
assert
variable
22
import pytest from thefuck.types import Command from thefuck.rules.git_push_without_commits import ( fix, get_new_command, match, ) command = 'git push -u origin master' expected_error = ''' error: src refspec master does not match any. error: failed to push some refs to 'git@github.com:User/repo.git' '''...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_git_rebase_merge_dir.py
test_get_new_command
assert
variable
27
import pytest from thefuck.rules.git_rebase_merge_dir import match, get_new_command from thefuck.types import Command def output(): return ('\n\nIt seems that there is already a rebase-merge directory, and\n' 'I wonder if you are in the middle of another rebase. If that is the\n' 'case, pl...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_git_two_dashes.py
test_get_new_command
assert
variable
24
import pytest from thefuck.rules.git_two_dashes import match, get_new_command from thefuck.types import Command output = 'error: did you mean `{}` (with two dashes ?)'.format @pytest.mark.parametrize('command, output', [ (Command('git add -patch', output('--patch')), 'git add --patch'), (Command('git ...
output
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_gradle_not_task.py
test_get_new_command
assert
variable
138
import pytest from io import BytesIO from thefuck.rules.gradle_no_task import match, get_new_command from thefuck.types import Command gradle_tasks = b''' :tasks ------------------------------------------------------------ All tasks runnable from root project ----------------------------------------------------------...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_gradle_wrapper.py
test_get_new_command
assert
variable
16
import pytest from thefuck.rules.gradle_wrapper import match, get_new_command from thefuck.types import Command def exists(mocker): return mocker.patch('thefuck.rules.gradle_wrapper.os.path.isfile', return_value=True) @pytest.mark.parametrize('script, result', [ ('gradle assemble', './...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_grep_arguments_order.py
test_get_new_command
assert
variable
19
import pytest from thefuck.rules.grep_arguments_order import get_new_command, match from thefuck.types import Command output = 'grep: {}: No such file or directory'.format def os_path(monkeypatch): monkeypatch.setattr('os.path.isfile', lambda x: not x.startswith('-')) @pytest.mark.parametrize('script, output, re...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_grunt_task_not_found.py
test_get_new_command
assert
variable
111
from io import BytesIO import pytest from thefuck.types import Command from thefuck.rules.grunt_task_not_found import match, get_new_command output = ''' Warning: Task "{}" not found. Use --force to continue. Aborted due to warnings. Execution Time (2016-08-13 21:01:40 UTC+3) loading tasks 11ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_heroku_multiple_apps.py
test_get_new_command
assert
variable
40
import pytest from thefuck.types import Command from thefuck.rules.heroku_multiple_apps import match, get_new_command suggest_output = ''' ▸ Multiple apps in git remotes ▸ Usage: --remote heroku-dev ▸ or: --app myapp-dev ▸ Your local git repository has more than 1 app referenced in git remotes. ▸ B...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_heroku_not_command.py
test_get_new_command
assert
variable
16
import pytest from thefuck.types import Command from thefuck.rules.heroku_not_command import match, get_new_command suggest_output = ''' ▸ log is not a heroku command. ▸ Perhaps you meant logs? ▸ Run heroku _ to run heroku logs. ▸ Run heroku help for a list of available commands.''' @pytest.mark.param...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_history.py
test_get_new_command
assert
variable
15
import pytest from thefuck.rules.history import match, get_new_command from thefuck.types import Command def history_without_current(mocker): return mocker.patch( 'thefuck.rules.history.get_valid_history_without_current', return_value=['ls cat', 'diff x']) @pytest.mark.parametrize('script, result'...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor
nvbn/thefuck
25142f81f83cf63c73764ec6e1f581a37af6838f
341
train
train
tests/rules/test_hostscli.py
test_get_new_command
assert
variable
21
import pytest from thefuck.rules.hostscli import no_website, get_new_command, match from thefuck.types import Command no_website_long = ''' {}: No Domain list found for website: a_website_that_does_not_exist Please raise a Issue here: https://github.com/dhilipsiva/hostscli/issues/new if you think we should add domai...
result
25142f81f83cf63c73764ec6e1f581a37af6838f
341
v2_extractor_at_anchor