Improve :download-open tests

This commit is contained in:
Florian Bruhin 2016-09-09 18:42:55 +02:00
parent 433a8a8ced
commit 143a4af91b
2 changed files with 13 additions and 1 deletions

View File

@ -222,6 +222,12 @@ Feature: Downloading things from a website.
And I open the download
Then "Opening *download.bin* with [*python*]" should be logged
Scenario: Opening a download with a placeholder
When I open data/downloads/download.bin
And I wait until the download is finished
And I open the download with a placeholder
Then "Opening *download.bin* with [*python*]" should be logged
Scenario: Opening a download which does not exist
When I run :download-open with count 42
Then the error "There's no download 42!" should be shown

View File

@ -94,10 +94,16 @@ def download_prompt(tmpdir, quteproc, path):
@bdd.when("I open the download")
def download_open(quteproc):
cmd = '{} -c pass'.format(shlex.quote(sys.executable))
cmd = '{} -c "import sys; print(sys.argv[1])"'.format(shlex.quote(sys.executable))
quteproc.send_cmd(':download-open {}'.format(cmd))
@bdd.when("I open the download with a placeholder")
def download_open(quteproc):
cmd = '{} -c "import sys; print(sys.argv[1])"'.format(shlex.quote(sys.executable))
quteproc.send_cmd(':download-open {} {{}}'.format(cmd))
@bdd.when("I directly open the download")
def download_open_with_prompt(quteproc):
cmd = '{} -c pass'.format(shlex.quote(sys.executable))