Skip to content

Commit

Permalink
Fix HLM commands tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bgallois committed Jun 21, 2020
1 parent bd008bf commit f52e00c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions spyder_vim/tests/test_vim.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,37 +611,39 @@ def test_H_command(vim_bot):
main, editor_stack, editor, vim, qtbot = vim_bot
editor.stdkey_backspace()
cmd_line = vim.get_focus_widget()
qtbot.keyClicks(cmd_line, 'VGy')
qtbot.keyClicks(cmd_line, '10pG')
qtbot.keyClicks(cmd_line, 'ggVGy')
qtbot.keyClicks(cmd_line, '100pG')
first_position = editor.cursorForPosition(QPoint(0,0)).position()
qtbot.keyClicks(cmd_line, 'H')
position = editor.textCursor().position()
first_position = editor.cursorForPosition(QPoint(0,0)).position()
assert first_position == position


def test_L_command(vim_bot):
"""Test L command (Cursor moves to the bottom of the screen)."""
main, editor_stack, editor, vim, qtbot = vim_bot
editor.resize(400, 800)
editor.stdkey_backspace()
cmd_line = vim.get_focus_widget()
qtbot.keyClicks(cmd_line, 'VGy')
qtbot.keyClicks(cmd_line, '10pg')
qtbot.keyClicks(cmd_line, 'ggVGy')
qtbot.keyClicks(cmd_line, '100pgg')
first_position = editor.cursorForPosition(QPoint(0, editor.viewport().height())).position()
qtbot.keyClicks(cmd_line, 'L')
position = editor.textCursor().position()
first_position = editor.cursorForPosition(QPoint(0, editor.viewport().height())).position()
assert first_position == position


def test_M_command(vim_bot):
"""Test M command (Cursor moves to the middle of the screen)."""
main, editor_stack, editor, vim, qtbot = vim_bot
editor.resize(400, 800)
editor.stdkey_backspace()
cmd_line = vim.get_focus_widget()
qtbot.keyClicks(cmd_line, 'VGy')
qtbot.keyClicks(cmd_line, '10pg')
qtbot.keyClicks(cmd_line, 'ggVGy')
qtbot.keyClicks(cmd_line, '100p')
first_position = editor.cursorForPosition(QPoint(0, int(editor.viewport().height()*0.5))).position()
qtbot.keyClicks(cmd_line, 'M')
position = editor.textCursor().position()
first_position = editor.cursorForPosition(QPoint(0, int(editor.viewport().height()*0.5))).position()
assert first_position == position


Expand Down

0 comments on commit f52e00c

Please sign in to comment.