mirror of
https://github.com/nvbn/thefuck.git
synced 2025-04-20 09:40:46 +01:00
#366 Add sleep before checking history
This commit is contained in:
parent
dfa22bc92b
commit
08af616e3d
@ -1,3 +1,6 @@
|
|||||||
|
from time import sleep
|
||||||
|
|
||||||
|
|
||||||
def _set_confirmation(proc, require):
|
def _set_confirmation(proc, require):
|
||||||
proc.sendline(u'mkdir -p ~/.thefuck')
|
proc.sendline(u'mkdir -p ~/.thefuck')
|
||||||
proc.sendline(
|
proc.sendline(
|
||||||
@ -22,12 +25,14 @@ def with_confirmation(proc, TIMEOUT):
|
|||||||
|
|
||||||
def history_changed(proc, TIMEOUT, to):
|
def history_changed(proc, TIMEOUT, to):
|
||||||
"""Ensures that history changed."""
|
"""Ensures that history changed."""
|
||||||
|
sleep(1)
|
||||||
proc.send('\033[A')
|
proc.send('\033[A')
|
||||||
assert proc.expect([TIMEOUT, to])
|
assert proc.expect([TIMEOUT, to])
|
||||||
|
|
||||||
|
|
||||||
def history_not_changed(proc, TIMEOUT):
|
def history_not_changed(proc, TIMEOUT):
|
||||||
"""Ensures that history not changed."""
|
"""Ensures that history not changed."""
|
||||||
|
sleep(1)
|
||||||
proc.send('\033[A')
|
proc.send('\033[A')
|
||||||
assert proc.expect([TIMEOUT, u'fuck'])
|
assert proc.expect([TIMEOUT, u'fuck'])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user