mirror of
https://github.com/nvbn/thefuck.git
synced 2025-09-25 14:42:33 +01:00
#298 Wait before checking that history changed
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
from time import sleep
|
||||||
from pexpect import TIMEOUT
|
from pexpect import TIMEOUT
|
||||||
|
|
||||||
|
|
||||||
@@ -25,12 +26,14 @@ def with_confirmation(proc):
|
|||||||
|
|
||||||
def history_changed(proc, to):
|
def history_changed(proc, to):
|
||||||
"""Ensures that history changed."""
|
"""Ensures that history changed."""
|
||||||
|
sleep(2)
|
||||||
proc.send('\033[A')
|
proc.send('\033[A')
|
||||||
assert proc.expect([TIMEOUT, to])
|
assert proc.expect([TIMEOUT, to])
|
||||||
|
|
||||||
|
|
||||||
def history_not_changed(proc):
|
def history_not_changed(proc):
|
||||||
"""Ensures that history not changed."""
|
"""Ensures that history not changed."""
|
||||||
|
sleep(2)
|
||||||
proc.send('\033[A')
|
proc.send('\033[A')
|
||||||
assert proc.expect([TIMEOUT, u'fuck'])
|
assert proc.expect([TIMEOUT, u'fuck'])
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user