use shlex.quote instead of "{}"

This commit is contained in:
Daniel Schadt 2016-08-04 01:41:50 +02:00
parent cbe60b0638
commit 8f4377937d

View File

@ -19,6 +19,7 @@
import os
import sys
import shlex
import pytest_bdd as bdd
bdd.scenarios('downloads.feature')
@ -73,10 +74,10 @@ def download_prompt(tmpdir, quteproc, path):
@bdd.when("I open the download")
def download_open(quteproc):
cmd = '"{}" -c pass'.format(sys.executable)
cmd = '{} -c pass'.format(shlex.quote(sys.executable))
quteproc.send_cmd(':download-open {}'.format(cmd))
@bdd.when("I directly open the download")
def download_open(quteproc):
cmd = '"{}" -c pass'.format(sys.executable)
cmd = '{} -c pass'.format(shlex.quote(sys.executable))
quteproc.send_cmd(':prompt-open-download {}'.format(cmd))