From 68cdae184a4d5f0c0542c8092c156164511f58a3 Mon Sep 17 00:00:00 2001 From: Jason Rosenzweig Date: Sat, 5 Jun 2021 13:34:45 +0800 Subject: Less redundant code --- tests/unit/mainwindow/test_prompt.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/unit/mainwindow/test_prompt.py b/tests/unit/mainwindow/test_prompt.py index d5ef5a363..cb394e8c7 100644 --- a/tests/unit/mainwindow/test_prompt.py +++ b/tests/unit/mainwindow/test_prompt.py @@ -98,9 +98,9 @@ class TestFileCompletion: assert prompt._lineedit.text() == str(testdir / 'bar') @pytest.mark.parametrize("keys,expected", - [([], ['bar', 'bat', 'foo']), - ([Qt.Key_F], ['foo']), - ([Qt.Key_A], ['bar', 'bat'])]) + [([], ['..', 'bar', 'bat', 'foo']), + ([Qt.Key_F], ['..', 'foo']), + ([Qt.Key_A], ['..', 'bar', 'bat'])]) def test_filtering_path(self, qtbot, tmp_path, get_prompt, keys, expected): testdir = tmp_path / 'test' @@ -118,7 +118,7 @@ class TestFileCompletion: parent = prompt._file_model.index( os.path.dirname(prompt._lineedit.text())) index = prompt._file_model.index(row, 0, parent) - if not prompt._file_view.isRowHidden(index.row(), index.parent()) and index.data() != "..": + if not prompt._file_view.isRowHidden(index.row(), index.parent()): visible.append(index.data()) assert visible == expected -- cgit v1.2.3-54-g00ecf