I'd love to be able to emulate user interaction, know the messages he's seeing in the screen, emulate some keypress events, read next question, say next answer, etc.
I've been trying to get my head around how to use pyte for this purpose and I'm pretty sure it's possible, but I can't get to how. I'd like something like this pseudocode:
my_process = ['copier', 'copy', src_path, dst_path]
with some_magic_from_pyte(my_process) as input, screen:
assert 'do_you_love_me?' in screen.display
input.send('y')
assert 'your_name?' in screen.display
input.send('yajo\r')
assert my_process_did_what_it_had_to_do()
Any help on how to do something similar please? :pray: :innocent:
Hi there.
I'd love to see an example on how to use this to test a TUI.
Particularly, my project uses https://github.com/tmbo/questionary to ask questions to the user and print a TUI to choose the answers.
I'd love to be able to emulate user interaction, know the messages he's seeing in the screen, emulate some keypress events, read next question, say next answer, etc.
I've been trying to get my head around how to use
pyte
for this purpose and I'm pretty sure it's possible, but I can't get to how. I'd like something like this pseudocode:Any help on how to do something similar please? :pray: :innocent: