#1113: Ignore a rule that fails to load (#1124)

This commit is contained in:
Pablo Aguiar
2020-11-03 18:26:13 +01:00
committed by GitHub
parent c196e2901c
commit 9d3bcad229
4 changed files with 29 additions and 10 deletions
+6
View File
@@ -45,6 +45,12 @@ class TestCorrectedCommand(object):
class TestRule(object):
def test_from_path_rule_exception(self, mocker):
load_source = mocker.patch('thefuck.types.load_source',
side_effect=ImportError("No module named foo..."))
assert Rule.from_path(Path('git.py')) is None
load_source.assert_called_once_with('git', 'git.py')
def test_from_path(self, mocker):
match = object()
get_new_command = object()