Skip to content

[3.12] gh-106194: Rename duplicated tests in test_curses (GH-106196) #106216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-106194: Rename duplicated tests in test_curses (GH-106196)
(cherry picked from commit 3fb7c60)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
  • Loading branch information
sobolevn authored and miss-islington committed Jun 28, 2023
commit ae98dbe3bafb4152ea16d38fa23c7fc6e4db254d
15 changes: 11 additions & 4 deletions Lib/test/test_curses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,26 +1364,33 @@ def test_move_left(self):
self.mock_win.reset_mock()
self.textbox.do_command(curses.KEY_LEFT)
self.mock_win.move.assert_called_with(1, 0)
self.mock_win.reset_mock()

def test_move_right(self):
"""Test moving the cursor right."""
self.mock_win.reset_mock()
self.textbox.do_command(curses.KEY_RIGHT)
self.mock_win.move.assert_called_with(1, 2)
self.mock_win.reset_mock()

def test_move_left(self):
"""Test moving the cursor left."""
def test_move_left_and_right(self):
"""Test moving the cursor left and then right."""
self.mock_win.reset_mock()
self.textbox.do_command(curses.KEY_LEFT)
self.mock_win.move.assert_called_with(1, 0)
self.textbox.do_command(curses.KEY_RIGHT)
self.mock_win.move.assert_called_with(1, 2)
self.mock_win.reset_mock()

def test_move_up(self):
"""Test moving the cursor left."""
"""Test moving the cursor up."""
self.mock_win.reset_mock()
self.textbox.do_command(curses.KEY_UP)
self.mock_win.move.assert_called_with(0, 1)
self.mock_win.reset_mock()

def test_move_down(self):
"""Test moving the cursor left."""
"""Test moving the cursor down."""
self.mock_win.reset_mock()
self.textbox.do_command(curses.KEY_DOWN)
self.mock_win.move.assert_called_with(2, 1)
Expand Down