def with_confirmation(proc, TIMEOUT):
 _set_confirmation(proc, True)
 proc.sendline(u'ehco test')
 proc.sendline(u'fuck')
 assert proc.expect([TIMEOUT, u'echo test'])
 assert proc.expect([TIMEOUT, u'enter'])
 assert proc.expect_exact([TIMEOUT, u'ctrl+c'])
 proc.send('\n')
 assert proc.expect([TIMEOUT, u'test'])

def with_confirmation ( proc , TIMEOUT ) : _set_confirmation ( proc , True ) proc . sendline ( u'ehco test' ) proc . sendline ( u'fuck' ) assert proc . expect ( [ TIMEOUT , u'echo test' ] ) assert proc . expect ( [ TIMEOUT , u'enter' ] ) assert proc . expect_exact ( [ TIMEOUT , u'ctrl+c' ] ) proc . send ( '\n' ) assert proc . expect ( [ TIMEOUT , u'test' ] )
ensures that command can be fixed when confirmation enabled .