diff options
author | Jason Rosenzweig <mail4jasonr@gmail.com> | 2021-06-05 13:34:45 +0800 |
---|---|---|
committer | Jason Rosenzweig <mail4jasonr@gmail.com> | 2021-06-05 13:34:45 +0800 |
commit | 68cdae184a4d5f0c0542c8092c156164511f58a3 (patch) | |
tree | 681b3ae64ab3ae16de1df377d26f904307b80b40 /tests | |
parent | 412e428e9d2da8f85c6a3bb42fe5ac6d2fe5cb78 (diff) | |
download | qutebrowser-68cdae184a4d5f0c0542c8092c156164511f58a3.tar.gz qutebrowser-68cdae184a4d5f0c0542c8092c156164511f58a3.zip |
Less redundant code
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/mainwindow/test_prompt.py | 8 |
1 files changed, 4 insertions, 4 deletions
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 |