From 8d69d9d412b0b7d53f6ee365d3016f8d3c242779 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 8 Oct 2018 17:48:26 +0200 Subject: [PATCH] Fix download filename tests If we want the same restrictive escaping in existing downloads, we'll need to simulate Windows. --- tests/unit/browser/webkit/test_downloads.py | 1 + tests/unit/utils/test_utils.py | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/unit/browser/webkit/test_downloads.py b/tests/unit/browser/webkit/test_downloads.py index 91e778f8c..5c253d608 100644 --- a/tests/unit/browser/webkit/test_downloads.py +++ b/tests/unit/browser/webkit/test_downloads.py @@ -62,6 +62,7 @@ def test_download_model(qapp, qtmodeltester, config_stub, cookiejar_and_cache, '', None), ]) +@pytest.mark.fake_os('windows') def test_page_titles(url, title, out): assert downloads.suggested_fn_from_title(url, title) == out diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py index b901d2d74..3b580cd00 100644 --- a/tests/unit/utils/test_utils.py +++ b/tests/unit/utils/test_utils.py @@ -649,6 +649,7 @@ def test_sanitize_filename(inp, expected, monkeypatch): assert utils.sanitize_filename(inp) == expected +@pytest.mark.fake_os('windows') def test_sanitize_filename_empty_replacement(): name = '//' assert utils.sanitize_filename(name, replacement=None) == 'Bad File'