bdd: Add "I press the keys ..." step.
This commit is contained in:
parent
7cfea665ff
commit
9fe02d55c9
@ -165,6 +165,11 @@ def wait_time(quteproc, delay):
|
||||
time.sleep(float(delay))
|
||||
|
||||
|
||||
@bdd.when(bdd.parsers.re('I press the keys? "(?P<keys>[^"]*)"'))
|
||||
def press_keys(quteproc, keys):
|
||||
quteproc.press_keys(keys)
|
||||
|
||||
|
||||
@bdd.then(bdd.parsers.parse('"{pattern}" should not be logged'))
|
||||
def ensure_not_logged(quteproc, pattern):
|
||||
quteproc.ensure_not_logged(message=pattern)
|
||||
|
@ -281,6 +281,10 @@ class QuteProc(testprocess.Process):
|
||||
with open(path, 'r', encoding='utf-8') as f:
|
||||
return f.read()
|
||||
|
||||
def press_keys(self, keys):
|
||||
"""Press the given keys using :fake-key."""
|
||||
self.send_cmd(':fake-key -g "{}"'.format(keys))
|
||||
|
||||
|
||||
@pytest.yield_fixture(scope='module')
|
||||
def quteproc(qapp, httpbin, request):
|
||||
|
Loading…
Reference in New Issue
Block a user