1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-25 03:59:08 +00:00
2015-07-24 23:14:58 +03:00

34 lines
807 B
Python

def with_confirmation(proc):
"""Ensures that command can be fixed when confirmation enabled."""
proc.sendline('ehco test')
proc.sendline('fuck')
proc.expect('echo test')
proc.expect('enter')
proc.expect_exact('ctrl+c')
proc.send('\n')
proc.expect('test')
def refuse_with_confirmation(proc):
"""Ensures that fix can be refused when confirmation enabled."""
proc.sendline('ehco test')
proc.sendline('fuck')
proc.expect('echo test')
proc.expect('enter')
proc.expect_exact('ctrl+c')
proc.send('\003')
proc.expect('Aborted')
def without_confirmation(proc):
"""Ensures that command can be fixed when confirmation disabled."""
proc.sendline('ehco test')
proc.sendline('fuck')
proc.expect('echo test')
proc.expect('test')