]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106194: Rename duplicated tests in `test_curses` (#106196)
authorNikita Sobolev <mail@sobolevn.me>
Wed, 28 Jun 2023 20:41:08 +0000 (23:41 +0300)
committerGitHub <noreply@github.com>
Wed, 28 Jun 2023 20:41:08 +0000 (14:41 -0600)
Lib/test/test_curses.py

index 3ab837e4f95681aff64d151538ce9b01521cbada..31bc108e7712eab10955584c5f5040921645e8db 100644 (file)
@@ -1364,26 +1364,33 @@ class TextboxTest(unittest.TestCase):
         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)