forked from Textualize/textual
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Textualize#1698 from Textualize/fix-paste
Fix paste and test
- Loading branch information
Showing
4 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |