Add a (tmpdir) replacement for BDD tests

See #1639
This commit is contained in:
Florian Bruhin 2016-07-11 20:47:37 +02:00
parent 3d4cf1fc92
commit 9f9e41687f

View File

@ -179,7 +179,7 @@ def set_setting(quteproc, httpbin, sect, opt, value):
@bdd.when(bdd.parsers.parse("I run {command}"))
def run_command(quteproc, httpbin, command):
def run_command(quteproc, httpbin, tmpdir, command):
"""Run a qutebrowser command.
The suffix "with count ..." can be used to pass a count to the command.
@ -199,6 +199,7 @@ def run_command(quteproc, httpbin, command):
command = command.replace('(port)', str(httpbin.port))
command = command.replace('(testdata)', utils.abs_datapath())
command = command.replace('(tmpdir)', str(tmpdir))
quteproc.send_cmd(command, count=count, invalid=invalid)