1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-18 12:06:04 +00:00

#N/A: Return an ordered list from set of overridden aliases

This way it's ensured that whatever is used as cache key is always
ordered. Sets are unordered collections.
This commit is contained in:
Pablo Santiago Blum de Aguiar 2019-01-17 00:19:58 +01:00
parent 8093f7cab8
commit 2d81166213
2 changed files with 4 additions and 3 deletions

View File

@ -28,8 +28,9 @@ class TestFish(object):
('THEFUCK_OVERRIDDEN_ALIASES', '\ncut,\n\ngit,\tsed\r')])
def test_get_overridden_aliases(self, shell, os_environ, key, value):
os_environ[key] = value
assert shell._get_overridden_aliases() == {'cd', 'cut', 'git', 'grep',
'ls', 'man', 'open', 'sed'}
overridden = shell._get_overridden_aliases()
assert set(overridden) == {'cd', 'cut', 'git', 'grep',
'ls', 'man', 'open', 'sed'}
@pytest.mark.parametrize('before, after', [
('cd', 'cd'),

View File

@ -43,7 +43,7 @@ class Fish(Generic):
default = {'cd', 'grep', 'ls', 'man', 'open'}
for alias in overridden.split(','):
default.add(alias.strip())
return default
return sorted(default)
def app_alias(self, alias_name):
if settings.alter_history: