Test that the pilot can press most ASCII characters as keys.
()
| 48 | |
| 49 | |
| 50 | async def test_pilot_press_ascii_chars(): |
| 51 | """Test that the pilot can press most ASCII characters as keys.""" |
| 52 | keys_pressed = [] |
| 53 | |
| 54 | class TestApp(App[None]): |
| 55 | def on_key(self, event: events.Key) -> None: |
| 56 | keys_pressed.append(event.character) |
| 57 | |
| 58 | async with TestApp().run_test() as pilot: |
| 59 | for char in KEY_CHARACTERS_TO_TEST: |
| 60 | await pilot.press(char) |
| 61 | assert keys_pressed[-1] == char |
| 62 | |
| 63 | |
| 64 | async def test_pilot_exception_catching_app_compose(): |