add tests for default-open-dispatcher
This commit is contained in:
parent
aafcd1f1d7
commit
3d8dedc48b
@ -337,6 +337,20 @@ Feature: Downloading things from a website.
|
||||
And I open the download with a placeholder
|
||||
Then "Opening *download.bin* with [*python*]" should be logged
|
||||
|
||||
Scenario: Opening a download with default-open-dispatcher set
|
||||
When I set general -> default-open-dispatcher to python {} -c "import sys; print(sys.argv[1])"
|
||||
And I open data/downloads/download.bin without waiting
|
||||
And I wait until the download is finished
|
||||
And I open the download with no args
|
||||
Then "Opening *download.bin* with [*python*]" should be logged
|
||||
|
||||
Scenario: Opening a download with default-open-dispatcher set to cat
|
||||
When I set general -> default-open-dispatcher to cat
|
||||
And I open data/downloads/download.bin without waiting
|
||||
And I wait until the download is finished
|
||||
And I open the download with no args
|
||||
Then "Opening *download.bin* with [*cat*]" 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
|
||||
|
@ -44,7 +44,6 @@ def temporary_download_dir(quteproc, tmpdir):
|
||||
unwritable.ensure(dir=True)
|
||||
unwritable.chmod(0)
|
||||
|
||||
|
||||
@bdd.given("I clean old downloads")
|
||||
def clean_old_downloads(quteproc):
|
||||
quteproc.send_cmd(':download-cancel --all')
|
||||
@ -108,6 +107,11 @@ def download_open(quteproc):
|
||||
quteproc.send_cmd(':download-open {}'.format(cmd))
|
||||
|
||||
|
||||
@bdd.when("I open the download with no args")
|
||||
def download_open_plain(quteproc):
|
||||
quteproc.send_cmd(':download-open')
|
||||
|
||||
|
||||
@bdd.when("I open the download with a placeholder")
|
||||
def download_open_placeholder(quteproc):
|
||||
cmd = '{} -c "import sys; print(sys.argv[1])"'.format(
|
||||
|
Loading…
Reference in New Issue
Block a user