summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJason Rosenzweig <mail4jasonr@gmail.com>2021-06-04 01:03:52 +0800
committerJason Rosenzweig <mail4jasonr@gmail.com>2021-06-04 01:03:52 +0800
commit5610a43177e64a882896fbdd0e1befb66a65facc (patch)
tree127f14542db86e1c2c6e4ea0bc547c11a937187b /tests
parent3a0d20e5f96bb8188d2b4b29f544c35d94976923 (diff)
downloadqutebrowser-5610a43177e64a882896fbdd0e1befb66a65facc.tar.gz
qutebrowser-5610a43177e64a882896fbdd0e1befb66a65facc.zip
Not working with this commit, but have to commit to merge
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/mainwindow/test_prompt.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/unit/mainwindow/test_prompt.py b/tests/unit/mainwindow/test_prompt.py
index 8f32d6338..71d94e51d 100644
--- a/tests/unit/mainwindow/test_prompt.py
+++ b/tests/unit/mainwindow/test_prompt.py
@@ -95,20 +95,21 @@ class TestFileCompletion:
prompt.item_focus('next')
prompt.item_focus('next')
assert prompt._lineedit.text() == str(testdir / 'bar')
-
+
def test_filtering_path(self, qtbot, tmp_path, get_prompt):
testdir = tmp_path / 'test'
for directory in ['bar', 'foo', 'bat']:
(testdir / directory).mkdir(parents=True)
-
+
prompt = get_prompt(str(testdir) + os.sep)
# Make sure all directories are shown
num_rows = prompt._file_model.rowCount(prompt._root_index)
visible = []
for row in range(num_rows):
- index = prompt._file_model.index(row, 0, prompt._file_model.index(os.path.basename(prompt._lineedit.text())))
+ parent = prompt._file_model.index(os.path.basename(prompt._lineedit.text()))
+ index = prompt._file_model.index(row, 0, parent)
if prompt._file_view.isRowHidden(index.row(), index.parent()):
visible.append(index.data())
@@ -119,7 +120,8 @@ class TestFileCompletion:
num_rows = prompt._file_model.rowCount(prompt._root_index)
visible = []
for row in range(num_rows):
- index = prompt._file_model.index(row, 0, prompt._file_model.index(os.path.basename(prompt._lineedit.text())))
+ parent = prompt._file_model.index(os.path.basename(prompt._lineedit.text()))
+ index = prompt._file_model.index(row, 0, parent)
if prompt._file_view.isRowHidden(index.row(), index.parent()):
visible.append(index.data())