Fix download filename tests

If we want the same restrictive escaping in existing downloads, we'll need to
simulate Windows.
This commit is contained in:
Florian Bruhin 2018-10-08 17:48:26 +02:00
parent 1abfc03965
commit 8d69d9d412
2 changed files with 2 additions and 0 deletions

View File

@ -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

View File

@ -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 = '/<Bad File>/'
assert utils.sanitize_filename(name, replacement=None) == 'Bad File'