mirror of
https://github.com/nvbn/thefuck.git
synced 2025-04-14 06:40:49 +01:00
commit
b7002bb9f9
22
appveyor.yml
Normal file
22
appveyor.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
build: false
|
||||||
|
|
||||||
|
environment:
|
||||||
|
matrix:
|
||||||
|
- PYTHON: "C:/Python27"
|
||||||
|
- PYTHON: "C:/Python33"
|
||||||
|
- PYTHON: "C:/Python34"
|
||||||
|
- PYTHON: "C:/Python35"
|
||||||
|
|
||||||
|
init:
|
||||||
|
- "ECHO %PYTHON%"
|
||||||
|
- ps: "ls C:/Python*"
|
||||||
|
|
||||||
|
install:
|
||||||
|
- ps: (new-object net.webclient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'C:/get-pip.py')
|
||||||
|
- "%PYTHON%/python.exe C:/get-pip.py"
|
||||||
|
- "%PYTHON%/Scripts/pip.exe install -U setuptools"
|
||||||
|
- "%PYTHON%/python.exe setup.py develop"
|
||||||
|
- "%PYTHON%/Scripts/pip.exe install -U -r requirements.txt"
|
||||||
|
|
||||||
|
test_script:
|
||||||
|
- "%PYTHON%/Scripts/py.test.exe -sv"
|
@ -52,6 +52,7 @@ def test_match(ssh_error):
|
|||||||
assert not match(Command('ssh'))
|
assert not match(Command('ssh'))
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(os.name == 'nt', reason='Skip if testing on Windows')
|
||||||
def test_side_effect(ssh_error):
|
def test_side_effect(ssh_error):
|
||||||
errormsg, path, reset, known_hosts = ssh_error
|
errormsg, path, reset, known_hosts = ssh_error
|
||||||
command = Command('ssh user@host', stderr=errormsg)
|
command = Command('ssh user@host', stderr=errormsg)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from pathlib import PosixPath
|
from pathlib import Path
|
||||||
from thefuck import corrector, const
|
from thefuck import corrector, const
|
||||||
from tests.utils import Rule, Command, CorrectedCommand
|
from tests.utils import Rule, Command, CorrectedCommand
|
||||||
from thefuck.corrector import get_corrected_commands, organize_commands
|
from thefuck.corrector import get_corrected_commands, organize_commands
|
||||||
@ -30,7 +30,7 @@ class TestGetRules(object):
|
|||||||
(['git.py', 'bash.py'], ['git'], ['git'], [])])
|
(['git.py', 'bash.py'], ['git'], ['git'], [])])
|
||||||
def test_get_rules(self, glob, settings, paths, conf_rules, exclude_rules,
|
def test_get_rules(self, glob, settings, paths, conf_rules, exclude_rules,
|
||||||
loaded_rules):
|
loaded_rules):
|
||||||
glob([PosixPath(path) for path in paths])
|
glob([Path(path) for path in paths])
|
||||||
settings.update(rules=conf_rules,
|
settings.update(rules=conf_rules,
|
||||||
priority={},
|
priority={},
|
||||||
exclude_rules=exclude_rules)
|
exclude_rules=exclude_rules)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
from subprocess import PIPE
|
from subprocess import PIPE
|
||||||
from mock import Mock
|
from mock import Mock
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -39,9 +40,10 @@ class TestRule(object):
|
|||||||
enabled_by_default=True,
|
enabled_by_default=True,
|
||||||
priority=900,
|
priority=900,
|
||||||
requires_output=True))
|
requires_output=True))
|
||||||
assert Rule.from_path(Path('/rules/bash.py')) \
|
rule_path = os.path.join(os.sep, 'rules', 'bash.py')
|
||||||
|
assert Rule.from_path(Path(rule_path)) \
|
||||||
== Rule('bash', match, get_new_command, priority=900)
|
== Rule('bash', match, get_new_command, priority=900)
|
||||||
load_source.assert_called_once_with('bash', '/rules/bash.py')
|
load_source.assert_called_once_with('bash', rule_path)
|
||||||
|
|
||||||
@pytest.mark.parametrize('rules, exclude_rules, rule, is_enabled', [
|
@pytest.mark.parametrize('rules, exclude_rules, rule, is_enabled', [
|
||||||
(const.DEFAULT_RULES, [], Rule('git', enabled_by_default=True), True),
|
(const.DEFAULT_RULES, [], Rule('git', enabled_by_default=True), True),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user