mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 20:11:17 +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:
parent
8093f7cab8
commit
2d81166213
@ -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'),
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user