From 07b3a7db7c0fd7f5f66aaa53c9f475532bb84410 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Fri, 24 Mar 2017 11:55:17 +0100 Subject: [PATCH] add integration tests for reserved filenames --- qutebrowser/mainwindow/prompt.py | 1 + tests/end2end/features/downloads.feature | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/qutebrowser/mainwindow/prompt.py b/qutebrowser/mainwindow/prompt.py index ff676146d..2f833c3a3 100644 --- a/qutebrowser/mainwindow/prompt.py +++ b/qutebrowser/mainwindow/prompt.py @@ -665,6 +665,7 @@ class FilenamePrompt(_BasePrompt): return path def _show_error(self, msg): + log.prompt.error(msg) QToolTip.showText(self._lineedit.mapToGlobal(QPoint(0, 0)), msg) def accept(self, value=None): diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature index 444cf8721..b47edf8d8 100644 --- a/tests/end2end/features/downloads.feature +++ b/tests/end2end/features/downloads.feature @@ -126,6 +126,20 @@ Feature: Downloading things from a website. Then the downloaded file ../foo should not exist And the downloaded file foo should exist + @windows + Scenario: Downloading a file to a reserved path + When I open data/downloads/download.bin + And I run :prompt-accept COM1 + And I run :prompt-cancel + Then "Invalid filename" should be logged + + @windows + Scenario: Downloading a file to a drive-relative working directory + When I open data/downloads/download.bin + And I run :prompt-accept C:foobar + And I run :prompt-cancel + Then "Invalid filename" should be logged + ## :download-retry Scenario: Retrying a failed download