mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-12 07:59:01 +00:00
Fix without result
This commit is contained in:
parent
faa7ee6030
commit
e2e8b6fc86
@ -44,6 +44,10 @@ class TestSortedCorrectedCommandsSequence(object):
|
|||||||
assert set(seq) == {CorrectedCommand('ls', priority=100),
|
assert set(seq) == {CorrectedCommand('ls', priority=100),
|
||||||
CorrectedCommand('ls', side_effect, 300)}
|
CorrectedCommand('ls', side_effect, 300)}
|
||||||
|
|
||||||
|
def test_with_blank(self, settings):
|
||||||
|
seq = SortedCorrectedCommandsSequence(iter([]), settings)
|
||||||
|
assert list(seq) == []
|
||||||
|
|
||||||
|
|
||||||
class TestCorrectedCommand(object):
|
class TestCorrectedCommand(object):
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@ class SortedCorrectedCommandsSequence(object):
|
|||||||
|
|
||||||
def _realise(self):
|
def _realise(self):
|
||||||
"""Realises generator, removes duplicates and sorts commands."""
|
"""Realises generator, removes duplicates and sorts commands."""
|
||||||
|
if self._cached:
|
||||||
commands = self._remove_duplicates(self._commands)
|
commands = self._remove_duplicates(self._commands)
|
||||||
self._cached = [self._cached[0]] + sorted(
|
self._cached = [self._cached[0]] + sorted(
|
||||||
commands, key=lambda corrected_command: corrected_command.priority)
|
commands, key=lambda corrected_command: corrected_command.priority)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user