Skip to content

Commit

Permalink
Remove arrow key test
Browse files Browse the repository at this point in the history
We aren't implementing this behavior anymore (it's the default with
QTreeView), so we don't need to test it.
  • Loading branch information
gselzer committed Aug 17, 2023
1 parent a09b98b commit 29cd578
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions tests/widgets/test_result_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,28 +96,11 @@ def test_arrow_key_expansion(fixed_tree: SearcherTreeView, qtbot, asserter):
idx = fixed_tree.model().index(0, 0)
fixed_tree.setCurrentIndex(idx)
expanded = fixed_tree.isExpanded(idx)
# Part 1: toggle with Enter
# Toggle with enter
qtbot.keyPress(fixed_tree, Qt.Key_Return)
assert fixed_tree.isExpanded(idx) is not expanded
qtbot.keyPress(fixed_tree, Qt.Key_Return)
assert fixed_tree.isExpanded(idx) is expanded
# Part 2: test arrow keys
fixed_tree.setExpanded(idx, True)
# Part 2.1: Expanded + Left hides children
qtbot.keyPress(fixed_tree, Qt.Key_Left)
assert fixed_tree.isExpanded(idx) is False
# Part 2.2: Hidden + Right shows children
qtbot.keyPress(fixed_tree, Qt.Key_Right)
assert fixed_tree.isExpanded(idx) is True
# Part 2.3: Expanded + Right selects first child
qtbot.keyPress(fixed_tree, Qt.Key_Right)
asserter(
lambda: fixed_tree.currentIndex().row() == 0
and fixed_tree.currentIndex().parent() == idx
)
# Part 2.4: Child + Left returns to parent
qtbot.keyPress(fixed_tree, Qt.Key_Left)
asserter(lambda: fixed_tree.currentIndex() == idx)


def test_search_tree_disable(fixed_tree: SearcherTreeView, asserter):
Expand Down

0 comments on commit 29cd578

Please sign in to comment.