summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
author$MYNAME <$MYGITEMAIL>2021-03-03 14:03:03 +0100
committer$MYNAME <$MYGITEMAIL>2021-03-03 14:03:03 +0100
commit82ba01647b9000b5422f6f77e874acdf4f5a511d (patch)
tree9e86d557fd1fb72660242a4f0f29d7ad0cfcaac2 /tests
parent18340ada86cc752cc8f90b1c44ff199993876885 (diff)
downloadqutebrowser-82ba01647b9000b5422f6f77e874acdf4f5a511d.tar.gz
qutebrowser-82ba01647b9000b5422f6f77e874acdf4f5a511d.zip
Better handling of filepicker commands, updated test
Diffstat (limited to 'tests')
-rw-r--r--tests/end2end/features/test_editor_bdd.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/tests/end2end/features/test_editor_bdd.py b/tests/end2end/features/test_editor_bdd.py
index 8ec8cf98e..40f77a0f7 100644
--- a/tests/end2end/features/test_editor_bdd.py
+++ b/tests/end2end/features/test_editor_bdd.py
@@ -187,18 +187,24 @@ def set_up_fileselector(quteproc, py_proc, kind, files, output_type):
cmd, args = py_proc(r"""
import os
import sys
- if '--' in sys.argv:
- tmp_file = sys.argv[-1]
+ tmp_file = None
+ for i, arg in enumerate(sys.argv):
+ if arg.startswith('--file='):
+ tmp_file = arg[len('--file='):]
+ sys.argv.pop(i)
+ break
+ selected_files = sys.argv[1:]
+ if tmp_file is None:
+ for selected_file in selected_files:
+ print(os.path.abspath(selected_file))
+ else:
with open(tmp_file, 'w') as f:
- for selected_file in sys.argv[1:-2]:
+ for selected_file in selected_files:
f.write(os.path.abspath(selected_file) + '\n')
- else:
- for selected_file in sys.argv[1:]:
- print(os.path.abspath(selected_file))
""")
args += files.split(' ')
if output_type == "a temporary file":
- args += ['--', '{}']
+ args += ['--file={}']
fileselect_cmd = json.dumps([cmd, *args])
quteproc.set_setting('fileselect.handler', 'external')
quteproc.set_setting(f'fileselect.{kind}.command', fileselect_cmd)