mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Fix paste and test
This commit is contained in:
18
tests/test_paste.py
Normal file
18
tests/test_paste.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from textual.app import App
|
||||
from textual import events
|
||||
|
||||
|
||||
async def test_paste_app():
|
||||
paste_events = []
|
||||
|
||||
class PasteApp(App):
|
||||
def on_paste(self, event):
|
||||
paste_events.append(event)
|
||||
|
||||
app = PasteApp()
|
||||
async with app.run_test() as pilot:
|
||||
await app.post_message(events.Paste(sender=app, text="Hello"))
|
||||
await pilot.pause(0)
|
||||
|
||||
assert len(paste_events) == 1
|
||||
assert paste_events[0].text == "Hello"
|
||||
Reference in New Issue
Block a user