def refuse_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('\x03')
 assert proc.expect([TIMEOUT, u'Aborted'])

def refuse_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 ( '\x03' ) assert proc . expect ( [ TIMEOUT , u'Aborted' ] )
ensures that fix can be refused when confirmation enabled .