repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_tag_force.py | tests/rules/test_git_tag_force.py | import pytest
from thefuck.rules.git_tag_force import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output():
return '''fatal: tag 'alert' already exists'''
def test_match(output):
assert match(Command('git tag alert', output))
assert not match(Command('git tag alert', '')... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_mkdir_p.py | tests/rules/test_mkdir_p.py | import pytest
from thefuck.rules.mkdir_p import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('mkdir foo/bar/baz', 'mkdir: foo/bar: No such file or directory'),
Command('./bin/hdfs dfs -mkdir foo/bar/baz', 'mkdir: `foo/bar/baz\': No such file or directo... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_branch_list.py | tests/rules/test_git_branch_list.py | from thefuck.rules.git_branch_list import match, get_new_command
from thefuck.shells import shell
from thefuck.types import Command
def test_match():
assert match(Command('git branch list', ''))
def test_not_match():
assert not match(Command('', ''))
assert not match(Command('git commit', ''))
asser... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_ls_all.py | tests/rules/test_ls_all.py | from thefuck.rules.ls_all import match, get_new_command
from thefuck.types import Command
def test_match():
assert match(Command('ls', ''))
assert not match(Command('ls', 'file.py\n'))
def test_get_new_command():
assert get_new_command(Command('ls empty_dir', '')) == 'ls -A empty_dir'
assert get_new... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_ln_s_order.py | tests/rules/test_ln_s_order.py | import pytest
from thefuck.rules.ln_s_order import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def file_exists(mocker):
return mocker.patch('os.path.exists', return_value=True)
get_output = "ln: failed to create symbolic link '{}': File exists".format
@pytest.mark.parametrize('scr... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_brew_uninstall.py | tests/rules/test_brew_uninstall.py | import pytest
from thefuck.types import Command
from thefuck.rules.brew_uninstall import get_new_command, match
@pytest.fixture
def output():
return ("Uninstalling /usr/local/Cellar/tbb/4.4-20160916... (118 files, 1.9M)\n"
"tbb 4.4-20160526, 4.4-20160722 are still installed.\n"
"Remove all... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_docker_login.py | tests/rules/test_docker_login.py | from thefuck.rules.docker_login import match, get_new_command
from thefuck.types import Command
def test_match():
err_response1 = """
Sending build context to Docker daemon 118.8kB
Step 1/6 : FROM foo/bar:fdb7c6d
pull access denied for foo/bar, repository does not exist or may require 'docker login'
"""
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_flag_after_filename.py | tests/rules/test_git_flag_after_filename.py | 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... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_unknown_command.py | tests/rules/test_unknown_command.py | import pytest
from thefuck.rules.unknown_command import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('./bin/hdfs dfs ls', 'ls: Unknown command\nDid you mean -ls? This command begins with a dash.'),
Command('hdfs dfs ls',
'ls: Unknown comma... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_man.py | tests/rules/test_man.py | import pytest
from thefuck.rules.man import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('man read', ''),
Command('man 2 read', ''),
Command('man 3 read', ''),
Command('man -s2 read', ''),
Command('man -s3 read', ''),
Command('man -s 2 ... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_pacman_invalid_option.py | tests/rules/test_pacman_invalid_option.py | import pytest
from thefuck.rules.pacman_invalid_option import get_new_command, match
from thefuck.types import Command
good_output = """community/shared_meataxe 1.0-3
A set of programs for working with matrix representations over finite fields
"""
bad_output = "error: invalid option '-"
@pytest.mark.parametrize... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_brew_unknown_command.py | tests/rules/test_brew_unknown_command.py | 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
@pytest.fixture
def brew_unknown_cmd():
return '''Error: Unknown command: inst'''
@pytest.fixture
def brew_unknown_cmd2():
retur... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_dirty_unzip.py | tests/rules/test_dirty_unzip.py | # -*- coding: utf-8 -*-
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
@pytest.fixture
def zip_error(tmpdir):
def zip_error_inner(filename):
path = os.path.join(str(tmpdir... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_gradle_wrapper.py | tests/rules/test_gradle_wrapper.py | import pytest
from thefuck.rules.gradle_wrapper import match, get_new_command
from thefuck.types import Command
@pytest.fixture(autouse=True)
def exists(mocker):
return mocker.patch('thefuck.rules.gradle_wrapper.os.path.isfile',
return_value=True)
@pytest.mark.parametrize('command', [
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_brew_link.py | tests/rules/test_brew_link.py | import pytest
from thefuck.types import Command
from thefuck.rules.brew_link import get_new_command, match
@pytest.fixture
def output():
return ("Error: Could not symlink bin/gcp\n"
"Target /usr/local/bin/gcp\n"
"already exists. You may want to remove it:\n"
" rm '/usr/local/b... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_grunt_task_not_found.py | tests/rules/test_grunt_task_not_found.py | # -*- encoding: utf-8 -*-
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 task... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_yarn_help.py | tests/rules/test_yarn_help.py | import pytest
from thefuck.rules.yarn_help import match, get_new_command
from thefuck.types import Command
from thefuck.system import open_command
output_clean = '''
Usage: yarn [command] [flags]
Options:
-h, --help output usage information
-V, --version output th... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_hostscli.py | tests/rules/test_hostscli.py | 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... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_not_command.py | tests/rules/test_git_not_command.py | import pytest
from thefuck.rules.git_not_command import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def git_not_command():
return """git: 'brnch' is not a git command. See 'git --help'.
The most similar command is
branch
"""
@pytest.fixture
def git_not_command_one_of_this():
re... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_merge_unrelated.py | tests/rules/test_git_merge_unrelated.py | import pytest
from thefuck.rules.git_merge_unrelated import match, get_new_command
from thefuck.types import Command
output = 'fatal: refusing to merge unrelated histories'
def test_match():
assert match(Command('git merge test', output))
assert not match(Command('git merge master', ''))
assert not matc... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_missing_space_before_subcommand.py | tests/rules/test_missing_space_before_subcommand.py | import pytest
from thefuck.rules.missing_space_before_subcommand import (
match, get_new_command)
from thefuck.types import Command
@pytest.fixture(autouse=True)
def all_executables(mocker):
return mocker.patch(
'thefuck.rules.missing_space_before_subcommand.get_all_executables',
return_value=... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_two_dashes.py | tests/rules/test_git_two_dashes.py | 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', [
Command('git add -patch', output('--patch')),
Command('git checkout -patch', output('--patch'))... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_checkout.py | tests/rules/test_git_checkout.py | import pytest
from io import BytesIO
from thefuck.rules.git_checkout import match, get_branches, get_new_command
from thefuck.types import Command
def did_not_match(target, did_you_forget=False):
error = ("error: pathspec '{}' did not match any "
"file(s) known to git.".format(target))
if did_you... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_heroku_not_command.py | tests/rules/test_heroku_not_command.py | # -*- coding: utf-8 -*-
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 comman... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_rm_dir.py | tests/rules/test_rm_dir.py | import pytest
from thefuck.rules.rm_dir import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('rm foo', 'rm: foo: is a directory'),
Command('rm foo', 'rm: foo: Is a directory'),
Command('hdfs dfs -rm foo', 'rm: `foo`: Is a directory'),
Command('.... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_remove_shell_prompt_literal.py | tests/rules/test_remove_shell_prompt_literal.py | import pytest
from thefuck.rules.remove_shell_prompt_literal import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output():
return "$: command not found"
@pytest.mark.parametrize(
"script",
[
"$ cd newdir",
" $ cd newdir",
"$ $ cd newdir",
"... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_no_command.py | tests/rules/test_no_command.py | import pytest
from thefuck.rules.no_command import match, get_new_command
from thefuck.types import Command
@pytest.fixture(autouse=True)
def get_all_executables(mocker):
mocker.patch('thefuck.rules.no_command.get_all_executables',
return_value=['vim', 'fsck', 'git', 'go', 'python'])
@pytest.fi... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_main_master.py | tests/rules/test_git_main_master.py | import pytest
from thefuck.rules.git_main_master import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output(branch_name):
if not branch_name:
return ""
output_str = u"error: pathspec '{}' did not match any file(s) known to git"
return output_str.format(branch_name)
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_pull.py | tests/rules/test_git_pull.py | import pytest
from thefuck.rules.git_pull import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output():
return '''There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details
git pull <remote> <branch>... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_port_already_in_use.py | tests/rules/test_port_already_in_use.py | from io import BytesIO
import pytest
from thefuck.rules.port_already_in_use import match, get_new_command
from thefuck.types import Command
outputs = [
'''
DE 70% 1/1 build modulesevents.js:141
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 127.0.0.1:8080
at Object.exports._errn... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_terraform_no_command.py | tests/rules/test_terraform_no_command.py | import pytest
from thefuck.rules.terraform_no_command import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('script, output', [
('terraform appyl', 'Terraform has no command named "appyl". Did you mean "apply"?'),
('terraform destory', 'Terraform has no command named "destor... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_clone_missing.py | tests/rules/test_git_clone_missing.py | import pytest
from thefuck.rules.git_clone_missing import match, get_new_command
from thefuck.types import Command
valid_urls = [
'https://github.com/nvbn/thefuck.git',
'https://github.com/nvbn/thefuck',
'http://github.com/nvbn/thefuck.git',
'git@github.com:nvbn/thefuck.git',
'git@github.com:nvbn/t... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_dnf_no_such_command.py | tests/rules/test_dnf_no_such_command.py | from io import BytesIO
import pytest
from thefuck.types import Command
from thefuck.rules.dnf_no_such_command import match, get_new_command, _get_operations
help_text = b'''usage: dnf [options] COMMAND
List of Main Commands:
autoremove remove all unneeded packages that were originally installed as de... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_python_execute.py | tests/rules/test_python_execute.py | import pytest
from thefuck.rules.python_execute import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('python foo', ''),
Command('python bar', '')])
def test_match(command):
assert match(command)
@pytest.mark.parametrize('command, new_command', [
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_sudo.py | tests/rules/test_sudo.py | import pytest
from thefuck.rules.sudo import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('output', [
'Permission denied',
'permission denied',
"npm ERR! Error: EACCES, unlink",
'requested operation requires superuser privilege',
'need to be root',
'need ro... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_touch.py | tests/rules/test_touch.py | import pytest
from thefuck.rules.touch import match, get_new_command
from thefuck.types import Command
def output(is_bsd):
if is_bsd:
return "touch: /a/b/c: No such file or directory"
return "touch: cannot touch '/a/b/c': No such file or directory"
@pytest.mark.parametrize('script, is_bsd', [
('... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_cd_correction.py | tests/rules/test_cd_correction.py | import pytest
from thefuck.rules.cd_correction import match
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('cd foo', 'cd: foo: No such file or directory'),
Command('cd foo/bar/baz',
'cd: foo: No such file or directory'),
Command('cd foo/bar/baz', 'cd: can\'t cd... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_apt_get_search.py | tests/rules/test_apt_get_search.py | import pytest
from thefuck.rules.apt_get_search import get_new_command, match
from thefuck.types import Command
def test_match():
assert match(Command('apt-get search foo', ''))
@pytest.mark.parametrize('command', [
Command('apt-cache search foo', ''),
Command('aptitude search foo', ''),
Command('ap... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_heroku_multiple_apps.py | tests/rules/test_heroku_multiple_apps.py | # -*- coding: utf-8 -*-
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 referenc... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_python_command.py | tests/rules/test_python_command.py | from thefuck.rules.python_command import match, get_new_command
from thefuck.types import Command
def test_match():
assert match(Command('temp.py', 'Permission denied'))
assert not match(Command('', ''))
def test_get_new_command():
assert (get_new_command(Command('./test_sudo.py', ''))
== 'p... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_remote_delete.py | tests/rules/test_git_remote_delete.py | import pytest
from thefuck.rules.git_remote_delete import get_new_command, match
from thefuck.types import Command
def test_match():
assert match(Command('git remote delete foo', ''))
@pytest.mark.parametrize('command', [
Command('git remote remove foo', ''),
Command('git remote add foo', ''),
Comma... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_push_without_commits.py | tests/rules/test_git_push_without_commits.py | from thefuck.types import Command
from thefuck.rules.git_push_without_commits import get_new_command, match
def test_match():
script = "git push -u origin master"
output = "error: src refspec master does not match any\nerror: failed to..."
assert match(Command(script, output))
def test_not_match():
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_push.py | tests/rules/test_git_push.py | import pytest
from thefuck.rules.git_push import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output(branch_name):
if not branch_name:
return ''
return '''fatal: The current branch {} has no upstream branch.
To push the current branch and set the remote as upstream, use... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_java.py | tests/rules/test_java.py | import pytest
from thefuck.rules.java import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('java foo.java', ''),
Command('java bar.java', '')])
def test_match(command):
assert match(command)
@pytest.mark.parametrize('command, new_command', [
(... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_has_exists_script.py | tests/rules/test_has_exists_script.py | from mock import patch
from thefuck.rules.has_exists_script import match, get_new_command
from thefuck.types import Command
def test_match():
with patch('os.path.exists', return_value=True):
assert match(Command('main', 'main: command not found'))
assert match(Command('main --help',
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_quotation_marks.py | tests/rules/test_quotation_marks.py | import pytest
from thefuck.rules.quotation_marks import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command("git commit -m \'My Message\"", ''),
Command("git commit -am \"Mismatched Quotation Marks\'", ''),
Command("echo \"hello\'", '')])
def test_match(c... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_fab_command_not_found.py | tests/rules/test_fab_command_not_found.py | 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... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_fix_stash.py | tests/rules/test_git_fix_stash.py | 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... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_add.py | tests/rules/test_git_add.py | import pytest
from thefuck.rules.git_add import match, get_new_command
from thefuck.types import Command
@pytest.fixture(autouse=True)
def path_exists(mocker):
return mocker.patch('thefuck.rules.git_add.Path.exists',
return_value=True)
@pytest.fixture
def output(target):
return ("err... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_pip_unknown_command.py | tests/rules/test_pip_unknown_command.py | import pytest
from thefuck.rules.pip_unknown_command import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def pip_unknown_cmd_without_recommend():
return '''ERROR: unknown command "i"'''
@pytest.fixture
def broken():
return 'instatl'
@pytest.fixture
def suggested():
return '... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_brew_cask_dependency.py | tests/rules/test_brew_cask_dependency.py | 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 requireme... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_switch_lang.py | tests/rules/test_switch_lang.py | # -*- encoding: utf-8 -*-
import pytest
from thefuck.rules import switch_lang
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command(u'фзе-пуе', 'command not found: фзе-пуе'),
Command(u'λσ', 'command not found: λσ'),
Command(u'שפא-עקא', 'command not found: שפא-עקא'),
Command... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_ssh_known_host.py | tests/rules/test_ssh_known_host.py | import os
import pytest
from thefuck.rules.ssh_known_hosts import match, get_new_command, \
side_effect
from thefuck.types import Command
@pytest.fixture
def ssh_error(tmpdir):
path = os.path.join(str(tmpdir), 'known_hosts')
def reset(path):
with open(path, 'w') as fh:
lines = [
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_prove_recursively.py | tests/rules/test_prove_recursively.py | 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'''
@pytest.fixture
def isdir(mocker):
return mocker.patch('thefuck.rules.prove_recursively'
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_nixos_cmd_not_found.py | tests/rules/test_nixos_cmd_not_found.py | import pytest
from thefuck.rules.nixos_cmd_not_found import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('vim', 'nix-env -iA nixos.vim')])
def test_match(mocker, command):
mocker.patch('thefuck.rules.nixos_cmd_not_found', return_value=None)
assert ... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_commit_reset.py | tests/rules/test_git_commit_reset.py | import pytest
from thefuck.rules.git_commit_reset import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('script, output', [
('git commit -m "test"', 'test output'),
('git commit', '')])
def test_match(output, script):
assert match(Command(script, output))
@pytest.mark.... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_cd_parent.py | tests/rules/test_cd_parent.py | from thefuck.rules.cd_parent import match, get_new_command
from thefuck.types import Command
def test_match():
assert match(Command('cd..', 'cd..: command not found'))
assert not match(Command('', ''))
def test_get_new_command():
assert get_new_command(Command('cd..', '')) == 'cd ..'
| python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_brew_reinstall.py | tests/rules/test_brew_reinstall.py | import pytest
from thefuck.types import Command
from thefuck.rules.brew_reinstall import get_new_command, match
output = ("Warning: thefuck 9.9 is already installed and up-to-date\nTo "
"reinstall 9.9, run `brew reinstall thefuck`")
def test_match():
command = Command('brew install thefuck', output)
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_pacman.py | tests/rules/test_pacman.py | import pytest
from mock import patch
from thefuck.rules import pacman
from thefuck.rules.pacman import match, get_new_command
from thefuck.types import Command
pacman_cmd = getattr(pacman, 'pacman', 'pacman')
PKGFILE_OUTPUT_SUDO = 'core/sudo 1.8.13-13/usr/bin/sudo'
PKGFILE_OUTPUT_CONVERT = 'extra/imagemagick 6.9.1.0... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_hook_bypass.py | tests/rules/test_git_hook_bypass.py | import pytest
from thefuck.rules.git_hook_bypass import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize(
"command",
[
Command("git am", ""),
Command("git commit", ""),
Command("git commit -m 'foo bar'", ""),
Command("git push", ""),
Com... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_pull_unstaged_changes.py | tests/rules/test_git_pull_unstaged_changes.py | import pytest
from thefuck.rules.git_pull_uncommitted_changes import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output():
return '''error: Cannot pull with rebase: Your index contains uncommitted changes.'''
def test_match(output):
assert match(Command('git pull', output))
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_lein_not_task.py | tests/rules/test_lein_not_task.py | import pytest
from thefuck.rules.lein_not_task import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def is_not_task():
return ''''rpl' is not a task. See 'lein help'.
Did you mean this?
repl
jar
'''
def test_match(is_not_task):
assert match(Command('lein rpl', i... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_conda_mistype.py | tests/rules/test_conda_mistype.py | import pytest
from thefuck.rules.conda_mistype import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def mistype_response():
return """
CommandNotFoundError: No command 'conda lst'.
Did you mean 'conda list'?
"""
def test_match(mistype_response):
assert match(Command('conda ... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_help_aliased.py | tests/rules/test_git_help_aliased.py | import pytest
from thefuck.rules.git_help_aliased import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('script, output', [
('git help st', "`git st' is aliased to `status'"),
('git help ds', "`git ds' is aliased to `diff --staged'")])
def test_match(script, output):
ass... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_dirty_untar.py | tests/rules/test_dirty_untar.py | 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
@pytest.fixture
def tar_error(tmpdir):
def fixture(filename):
path = os.path.join(str(tmp... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_diff_no_index.py | tests/rules/test_git_diff_no_index.py | import pytest
from thefuck.rules.git_diff_no_index import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('git diff foo bar', '')])
def test_match(command):
assert match(command)
@pytest.mark.parametrize('command', [
Command('git diff --no-index foo... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_commit_add.py | tests/rules/test_git_commit_add.py | import pytest
from thefuck.rules.git_commit_add import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize(
"script, output",
[
('git commit -m "test"', "no changes added to commit"),
("git commit", "no changes added to commit"),
],
)
def test_match(output, sc... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_remove_trailing_cedilla.py | tests/rules/test_remove_trailing_cedilla.py | import pytest
from thefuck.rules.remove_trailing_cedilla import match, get_new_command, CEDILLA
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('wrong' + CEDILLA, ''),
Command('wrong with args' + CEDILLA, '')])
def test_match(command):
assert match(command)
@pytest.mark.p... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_django_south_ghost.py | tests/rules/test_django_south_ghost.py | import pytest
from thefuck.rules.django_south_ghost import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output():
return '''Traceback (most recent call last):
File "/home/nvbn/work/.../bin/python", line 42, in <module>
exec(compile(__file__f.read(), __file__, "exec"))
File ... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_rebase_merge_dir.py | tests/rules/test_git_rebase_merge_dir.py | import pytest
from thefuck.rules.git_rebase_merge_dir import match, get_new_command
from thefuck.types import Command
@pytest.fixture
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'
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_clone_git_clone.py | tests/rules/test_git_clone_git_clone.py | from thefuck.rules.git_clone_git_clone import match, get_new_command
from thefuck.types import Command
output_clean = """
fatal: Too many arguments.
usage: git clone [<options>] [--] <repo> [<dir>]
"""
def test_match():
assert match(Command('git clone git clone foo', output_clean))
def test_not_match():
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_sl_ls.py | tests/rules/test_sl_ls.py |
from thefuck.rules.sl_ls import match, get_new_command
from thefuck.types import Command
def test_match():
assert match(Command('sl', ''))
assert not match(Command('ls', ''))
def test_get_new_command():
assert get_new_command(Command('sl', '')) == 'ls'
| python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_rm_local_modifications.py | tests/rules/test_git_rm_local_modifications.py | import pytest
from thefuck.rules.git_rm_local_modifications import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output(target):
return ('error: the following file has local modifications:\n {}\n(use '
'--cached to keep the file, or -f to force removal)').format(targe... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_scm_correction.py | tests/rules/test_scm_correction.py | import pytest
from thefuck.rules.scm_correction import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def get_actual_scm_mock(mocker):
return mocker.patch('thefuck.rules.scm_correction._get_actual_scm',
return_value=None)
@pytest.mark.parametrize('script, output... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_stash_pop.py | tests/rules/test_git_stash_pop.py | import pytest
from thefuck.rules.git_stash_pop import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output():
return '''error: Your local changes to the following files would be overwritten by merge:'''
def test_match(output):
assert match(Command('git stash pop', output))
... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_sudo_command_from_user_path.py | tests/rules/test_sudo_command_from_user_path.py | import pytest
from thefuck.rules.sudo_command_from_user_path import match, get_new_command
from thefuck.types import Command
output = 'sudo: {}: command not found'
@pytest.fixture(autouse=True)
def which(mocker):
return mocker.patch('thefuck.rules.sudo_command_from_user_path.which',
retu... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_choco_install.py | tests/rules/test_choco_install.py | import pytest
from thefuck.rules.choco_install import match, get_new_command
from thefuck.types import Command
package_not_found_error = (
'Chocolatey v0.10.15\n'
'Installing the following packages:\n'
'logstitcher\n'
'By installing you accept licenses for the packages.\n'
'logstitcher not install... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_mvn_no_command.py | tests/rules/test_mvn_no_command.py | import pytest
from thefuck.rules.mvn_no_command import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('mvn', '[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plu... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_apt_invalid_operation.py | tests/rules/test_apt_invalid_operation.py | 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... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_react_native_command_unrecognized.py | tests/rules/test_react_native_command_unrecognized.py | import pytest
from io import BytesIO
from thefuck.rules.react_native_command_unrecognized import match, \
get_new_command
from thefuck.types import Command
output = "Unrecognized command '{}'".format
stdout = b'''
Scanning 615 folders for symlinks in /home/nvbn/work/zcho/BookkaWebView/node_modules (6ms)
Usage:... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_gem_unknown_command.py | tests/rules/test_gem_unknown_command.py | 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 ... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_whois.py | tests/rules/test_whois.py | import pytest
from thefuck.rules.whois import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('whois https://en.wikipedia.org/wiki/Main_Page', ''),
Command('whois https://en.wikipedia.org/', ''),
Command('whois meta.unix.stackexchange.com', '')])
def ... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_grep_arguments_order.py | tests/rules/test_grep_arguments_order.py | 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
@pytest.fixture(autouse=True)
def os_path(monkeypatch):
monkeypatch.setattr('os.path.isfile', lambda x: not x.startswith('-'))
@pytest.mark... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_mercurial.py | tests/rules/test_mercurial.py | import pytest
from thefuck.types import Command
from thefuck.rules.mercurial import (
extract_possibilities, match, get_new_command
)
@pytest.mark.parametrize('command', [
Command('hg base', (
"hg: unknown command 'base'"
'\n(did you mean one of blame, phase, rebase?)'
)),
Command('hg... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_omnienv_no_such_command.py | tests/rules/test_omnienv_no_such_command.py | import pytest
from thefuck.rules.omnienv_no_such_command import get_new_command, match
from thefuck.types import Command
@pytest.fixture
def output(pyenv_cmd):
return "pyenv: no such command `{}'".format(pyenv_cmd)
@pytest.fixture(autouse=True)
def Popen(mocker):
mock = mocker.patch('thefuck.rules.omnienv_... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_push_pull.py | tests/rules/test_git_push_pull.py | 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... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_adb_unknown_command.py | tests/rules/test_adb_unknown_command.py | import pytest
from thefuck.rules.adb_unknown_command import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output():
return '''Android Debug Bridge version 1.0.31
-d - directs command to the only connected USB device
retur... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_no_such_file.py | tests/rules/test_no_such_file.py | import pytest
from thefuck.rules.no_such_file import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('mv foo bar/foo', "mv: cannot move 'foo' to 'bar/foo': No such file or directory"),
Command('mv foo bar/', "mv: cannot move 'foo' to 'bar/': No such file ... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_systemctl.py | tests/rules/test_systemctl.py | from thefuck.rules.systemctl import match, get_new_command
from thefuck.types import Command
def test_match():
assert match(Command('systemctl nginx start', 'Unknown operation \'nginx\'.'))
assert match(Command('sudo systemctl nginx start', 'Unknown operation \'nginx\'.'))
assert not match(Command('system... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_docker_not_command.py | tests/rules/test_docker_not_command.py | import pytest
from io import BytesIO
from thefuck.types import Command
from thefuck.rules.docker_not_command import get_new_command, match
_DOCKER_SWARM_OUTPUT = '''
Usage: docker swarm COMMAND
Manage Swarm
Commands:
ca Display and rotate the root CA
init Initialize a swarm
join Join a ... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_apt_list_upgradable.py | tests/rules/test_apt_list_upgradable.py | # -*- coding: utf-8 -*-
import pytest
from thefuck.rules.apt_list_upgradable import get_new_command, match
from thefuck.types import Command
full_english_output = '''
Hit:1 http://us.archive.ubuntu.com/ubuntu zesty InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu zesty-updates InRelease
Get:3 http://us.archive.ubu... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_tmux.py | tests/rules/test_tmux.py | import pytest
from thefuck.rules.tmux import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def tmux_ambiguous():
return "ambiguous command: list, could be: " \
"list-buffers, list-clients, list-commands, list-keys, " \
"list-panes, list-sessions, list-windows"
de... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_ifconfig_device_not_found.py | tests/rules/test_ifconfig_device_not_found.py | import pytest
from six import BytesIO
from thefuck.rules.ifconfig_device_not_found import match, get_new_command
from thefuck.types import Command
output = '{}: error fetching interface information: Device not found'
stdout = b'''
wlp2s0 Link encap:Ethernet HWaddr 5c:51:4f:7c:58:5d
inet addr:192.168.0.... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_az_cli.py | tests/rules/test_az_cli.py | 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 ... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_docker_image_being_used_by_container.py | tests/rules/test_docker_image_being_used_by_container.py | from thefuck.rules.docker_image_being_used_by_container import match, get_new_command
from thefuck.types import Command
def test_match():
err_response = """Error response from daemon: conflict: unable to delete cd809b04b6ff (cannot be forced) - image is being used by running container e5e2591040d1"""
assert m... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_tsuru_login.py | tests/rules/test_tsuru_login.py | import pytest
from thefuck.rules.tsuru_login import match, get_new_command
from thefuck.types import Command
error_msg = (
"Error: you're not authenticated or your session has expired.",
("You're not authenticated or your session has expired. "
"Please use \"login\" command for authentication."),
)
@py... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_rm_recursive.py | tests/rules/test_git_rm_recursive.py | import pytest
from thefuck.rules.git_rm_recursive import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output(target):
return "fatal: not removing '{}' recursively without -r".format(target)
@pytest.mark.parametrize('script, target', [
('git rm foo', 'foo'),
('git rm foo b... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_cp_create_destination.py | tests/rules/test_cp_create_destination.py | import pytest
from thefuck.rules.cp_create_destination import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize(
"script, output",
[("cp", "cp: directory foo does not exist\n"), ("mv", "No such file or directory")],
)
def test_match(script, output):
assert match(Command(scr... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_push_force.py | tests/rules/test_git_push_force.py | 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 behin... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
nvbn/thefuck | https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_go_unknown_command.py | tests/rules/test_go_unknown_command.py | import pytest
from io import BytesIO
from thefuck.rules.go_unknown_command import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def build_misspelled_output():
return '''go bulid: unknown command
Run 'go help' for usage.'''
@pytest.fixture
def go_stderr(mocker):
stderr = b'''Go is ... | python | MIT | c7e7e1d884d3bb241ea6448f72a989434c2a35ec | 2026-01-04T14:38:15.457096Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.