Sort sessions in SessionMnager.list_sessions()

This commit is contained in:
Florian Bruhin 2017-08-08 07:56:10 +02:00
parent b7a296c81f
commit a20f017c7a
2 changed files with 2 additions and 2 deletions

View File

@ -426,7 +426,7 @@ class SessionManager(QObject):
base, ext = os.path.splitext(filename)
if ext == '.yml':
sessions.append(base)
return sessions
return sorted(sessions)
@cmdutils.register(instance='session-manager')
@cmdutils.argument('name', completion=miscmodels.session)

View File

@ -372,7 +372,7 @@ class TestListSessions:
(tmpdir / 'foo.yml').ensure()
(tmpdir / 'bar.yml').ensure()
sess_man = sessions.SessionManager(str(tmpdir))
assert sorted(sess_man.list_sessions()) == ['bar', 'foo']
assert sess_man.list_sessions() == ['bar', 'foo']
def test_with_other_files(self, tmpdir):
(tmpdir / 'foo.yml').ensure()