MCPcopy
hub / github.com/Textualize/textual / test_pilot_press_ascii_chars

Function test_pilot_press_ascii_chars

tests/test_pilot.py:50–61  ·  view source on GitHub ↗

Test that the pilot can press most ASCII characters as keys.

()

Source from the content-addressed store, hash-verified

48
49
50async 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
64async def test_pilot_exception_catching_app_compose():

Callers

nothing calls this directly

Calls 3

run_testMethod · 0.80
TestAppClass · 0.70
pressMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…