mirror of
https://github.com/nvbn/thefuck.git
synced 2025-09-21 04:32:37 +01:00
Fix tests with python 2
This commit is contained in:
@@ -1,42 +1,42 @@
|
||||
def with_confirmation(proc):
|
||||
"""Ensures that command can be fixed when confirmation enabled."""
|
||||
proc.sendline('mkdir -p ~/.thefuck')
|
||||
proc.sendline('echo "require_confirmation = True" > ~/.thefuck/settings.py')
|
||||
proc.sendline(u'mkdir -p ~/.thefuck')
|
||||
proc.sendline(u'echo "require_confirmation = True" > ~/.thefuck/settings.py')
|
||||
|
||||
proc.sendline('ehco test')
|
||||
proc.sendline(u'ehco test')
|
||||
|
||||
proc.sendline('fuck')
|
||||
proc.expect('echo test')
|
||||
proc.expect('enter')
|
||||
proc.expect_exact('ctrl+c')
|
||||
proc.sendline(u'fuck')
|
||||
proc.expect(u'echo test')
|
||||
proc.expect(u'enter')
|
||||
proc.expect_exact(u'ctrl+c')
|
||||
proc.send('\n')
|
||||
|
||||
proc.expect('test')
|
||||
proc.expect(u'test')
|
||||
|
||||
|
||||
def refuse_with_confirmation(proc):
|
||||
"""Ensures that fix can be refused when confirmation enabled."""
|
||||
proc.sendline('mkdir -p ~/.thefuck')
|
||||
proc.sendline('echo "require_confirmation = True" > ~/.thefuck/settings.py')
|
||||
proc.sendline(u'mkdir -p ~/.thefuck')
|
||||
proc.sendline(u'echo "require_confirmation = True" > ~/.thefuck/settings.py')
|
||||
|
||||
proc.sendline('ehco test')
|
||||
proc.sendline(u'ehco test')
|
||||
|
||||
proc.sendline('fuck')
|
||||
proc.expect('echo test')
|
||||
proc.expect('enter')
|
||||
proc.expect_exact('ctrl+c')
|
||||
proc.sendline(u'fuck')
|
||||
proc.expect(u'echo test')
|
||||
proc.expect(u'enter')
|
||||
proc.expect_exact(u'ctrl+c')
|
||||
proc.send('\003')
|
||||
|
||||
proc.expect('Aborted')
|
||||
proc.expect(u'Aborted')
|
||||
|
||||
|
||||
def without_confirmation(proc):
|
||||
"""Ensures that command can be fixed when confirmation disabled."""
|
||||
proc.sendline('mkdir -p ~/.thefuck')
|
||||
proc.sendline('echo "require_confirmation = False" > ~/.thefuck/settings.py')
|
||||
proc.sendline(u'mkdir -p ~/.thefuck')
|
||||
proc.sendline(u'echo "require_confirmation = False" > ~/.thefuck/settings.py')
|
||||
|
||||
proc.sendline('ehco test')
|
||||
proc.sendline(u'ehco test')
|
||||
|
||||
proc.sendline('fuck')
|
||||
proc.expect('echo test')
|
||||
proc.expect('test')
|
||||
proc.sendline(u'fuck')
|
||||
proc.expect(u'echo test')
|
||||
proc.expect(u'test')
|
||||
|
Reference in New Issue
Block a user