From 6293bc5178a0f91236e85a00ee82457cae991ebd Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 4 Sep 2018 23:21:51 +0200 Subject: [PATCH] Fix lint and test --- qutebrowser/browser/qutescheme.py | 5 ++--- tests/end2end/features/downloads.feature | 3 ++- tests/end2end/features/qutescheme.feature | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index 7ea85a861..35bd2a436 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -42,7 +42,6 @@ except ImportError: import pkg_resources from PyQt5.QtCore import QUrlQuery, QUrl -from PyQt5.QtNetwork import QNetworkReply import qutebrowser from qutebrowser.config import config, configdata, configexc, configdiff @@ -264,13 +263,13 @@ def qute_history(url): try: offset = QUrlQuery(url).queryItemValue("offset") offset = int(offset) if offset else None - except ValueError as e: + except ValueError: raise UrlInvalidError("Query parameter offset is invalid") # Use start_time in query or current time. try: start_time = QUrlQuery(url).queryItemValue("start_time") start_time = float(start_time) if start_time else time.time() - except ValueError as e: + except ValueError: raise UrlInvalidError("Query parameter start_time is invalid") return 'text/html', json.dumps(history_data(start_time, offset)) diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature index e62c7a030..3ca31139e 100644 --- a/tests/end2end/features/downloads.feature +++ b/tests/end2end/features/downloads.feature @@ -80,7 +80,8 @@ Feature: Downloading things from a website. And I open data/downloads/issue1243.html And I hint with args "links download" and follow a And I wait for "Asking question text=* title='Save file to:'>, *" in the log - Then the error "Download error: No handler found for qute://!" should be shown + Then the error "Download error: No handler found for qute://" should be shown + And "NotFoundError while handling qute://* URL" should be logged Scenario: Downloading a data: link (issue 1214) When I set downloads.location.suggestion to filename diff --git a/tests/end2end/features/qutescheme.feature b/tests/end2end/features/qutescheme.feature index 150f74988..fedf134be 100644 --- a/tests/end2end/features/qutescheme.feature +++ b/tests/end2end/features/qutescheme.feature @@ -159,7 +159,7 @@ Feature: Special qute:// pages Scenario: qute://settings CSRF token (webengine) When I open qute://settings And I run :jseval const xhr = new XMLHttpRequest(); xhr.open("GET", "qute://settings/set"); xhr.send() - Then "Error while handling qute://* URL" should be logged + Then "RequestDeniedError while handling qute://* URL" should be logged And the error "Invalid CSRF token for qute://settings!" should be shown @qtwebengine_skip