8000 gh-111201: Add more tests to test_pyrepl to cover key translation by pablogsal · Pull Request #118705 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111201: Add more tests to test_pyrepl to cover key translation #118705

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 3 commits into from
May 20, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'main' into more_tests
  • Loading branch information
ambv committed May 20, 2024
commit 8f4f62e96dec24b69d2aaf8f09e7a54c0829a64c
13 changes: 10 additions & 3 deletions Lib/test/test_pyrepl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,16 @@ def test_setpos_fromxy_in_wrapped_line(self):
reader.setpos_from_xy(0, 1)
self.assertEqual(reader.pos, 9)

def test_up_arrow_after_ctrl_r(self):
events = iter([
Event(evt='key', data='\x12', raw=bytearray(b'\x12')),
Event(evt='key', data='up', raw=bytearray(b'\x1bOA')),
])

reader, _ = handle_all_events(events)
self.assert_screen_equals(reader, "")


class KeymapTranslatorTests(unittest.TestCase):
def test_push_single_key(self):
keymap = [("a", "command_a")]
Expand Down Expand Up @@ -1185,8 +1195,5 @@ def test_nested_multiple_keymaps(self):
self.assertEqual(result, {b"a": {b"b": {b"c": "action"}}})


reader, _ = handle_all_events(events)
self.assert_screen_equals(reader, "")

if __name__ == '__main__':
unittest.main()
You are viewing a condensed version of this merge commit. You can view the full changes here.
0