mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Adjust pause test (#48125)
Use send() rather than sendlin() calls when testing interactive prompting and echo.
This commit is contained in:
parent
066af3b6ca
commit
8c49fd2a2c
1 changed files with 7 additions and 4 deletions
|
@ -246,7 +246,7 @@ pause_test.expect('user requested abort!')
|
||||||
pause_test.expect(pexpect.EOF)
|
pause_test.expect(pexpect.EOF)
|
||||||
pause_test.close()
|
pause_test.close()
|
||||||
|
|
||||||
# -- Enter input and ensure it's caputered, echoed, and can be edited -- #
|
# -- Enter input and ensure it's captured, echoed, and can be edited -- #
|
||||||
|
|
||||||
playbook = 'pause-5.yml'
|
playbook = 'pause-5.yml'
|
||||||
|
|
||||||
|
@ -259,12 +259,15 @@ pause_test = pexpect.spawn(
|
||||||
|
|
||||||
pause_test.logfile = log_buffer
|
pause_test.logfile = log_buffer
|
||||||
pause_test.expect(r'Enter some text:')
|
pause_test.expect(r'Enter some text:')
|
||||||
pause_test.sendline('hello there')
|
pause_test.send('hello there')
|
||||||
|
pause_test.send('\r')
|
||||||
pause_test.expect(r'Enter some text to edit:')
|
pause_test.expect(r'Enter some text to edit:')
|
||||||
pause_test.send('hello there')
|
pause_test.send('hello there')
|
||||||
pause_test.send(backspace * 4)
|
pause_test.send(backspace * 4)
|
||||||
pause_test.send('ommy boy\r')
|
pause_test.send('ommy boy')
|
||||||
|
pause_test.send('\r')
|
||||||
pause_test.expect(r'Enter some text \(output is hidden\):')
|
pause_test.expect(r'Enter some text \(output is hidden\):')
|
||||||
pause_test.sendline('supersecretpancakes')
|
pause_test.send('supersecretpancakes')
|
||||||
|
pause_test.send('\r')
|
||||||
pause_test.expect(pexpect.EOF)
|
pause_test.expect(pexpect.EOF)
|
||||||
pause_test.close()
|
pause_test.close()
|
||||||
|
|
Loading…
Reference in a new issue