From 11ee5befcca8fc09bcbaa07135b41f26f8c52b76 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 11 Sep 2016 15:53:46 +0200 Subject: [PATCH] Fix download tests on Windows --- tests/end2end/features/conftest.py | 2 ++ tests/end2end/features/downloads.feature | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/end2end/features/conftest.py b/tests/end2end/features/conftest.py index 4cbf5bd90..75532b04b 100644 --- a/tests/end2end/features/conftest.py +++ b/tests/end2end/features/conftest.py @@ -19,6 +19,7 @@ """Steps for bdd-like tests.""" +import os import re import sys import time @@ -222,6 +223,7 @@ def run_command(quteproc, httpbin, tmpdir, command): command = command.replace('(port)', str(httpbin.port)) command = command.replace('(testdata)', utils.abs_datapath()) command = command.replace('(tmpdir)', str(tmpdir)) + command = command.replace('(dirsep)', os.sep) quteproc.send_cmd(command, count=count, invalid=invalid) diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature index 07f5563e6..a59169372 100644 --- a/tests/end2end/features/downloads.feature +++ b/tests/end2end/features/downloads.feature @@ -371,7 +371,7 @@ Feature: Downloading things from a website. And I set storage -> remember-download-directory to true And I open data/downloads/download.bin And I wait for the download prompt for "*/download.bin" - And I run :prompt-accept (tmpdir)/subdir + And I run :prompt-accept (tmpdir)(dirsep)subdir And I open data/downloads/download2.bin Then the download prompt should be shown with "(tmpdir)/subdir/download2.bin" @@ -381,7 +381,7 @@ Feature: Downloading things from a website. And I set storage -> remember-download-directory to false And I open data/downloads/download.bin And I wait for the download prompt for "(tmpdir)/download.bin" - And I run :prompt-accept (tmpdir)/subdir + And I run :prompt-accept (tmpdir)(dirsep)subdir And I open data/downloads/download2.bin Then the download prompt should be shown with "(tmpdir)/download2.bin" @@ -420,7 +420,7 @@ Feature: Downloading things from a website. When I set storage -> prompt-download-directory to false And I run :download http://localhost:(port)/redirect/12 --dest redirection Then the error "Download error: Maximum redirection count reached!" should be shown - And "Deleted */redirection" should be logged + And "Deleted *redirection" should be logged And the downloaded file redirection should not exist Scenario: Downloading with redirect to itself