Don't move cache directory on Windows

This commit is contained in:
Florian Bruhin 2017-09-14 09:50:18 +02:00
parent 5cd14c941b
commit 12260e068a
2 changed files with 6 additions and 2 deletions

View File

@ -302,8 +302,9 @@ def _move_windows():
new_config_dir = os.path.join(new_appdata_dir, 'config')
_create(new_config_dir)
for f in os.listdir(old_appdata_dir):
_move_data(os.path.join(old_appdata_dir, f),
os.path.join(new_config_dir, f))
if f != 'cache':
_move_data(os.path.join(old_appdata_dir, f),
os.path.join(new_config_dir, f))
def _init_cachedir_tag():

View File

@ -467,12 +467,15 @@ class TestDataMigrations:
"""Test moving configs on Windows."""
(files.local_data_dir / 'data' / 'blocked-hosts').ensure()
(files.local_data_dir / 'qutebrowser.conf').ensure()
(files.local_data_dir / 'cache' / 'cachefile').ensure()
standarddir._move_windows()
assert (files.roaming_data_dir / 'data' / 'blocked-hosts').exists()
assert (files.roaming_data_dir / 'config' /
'qutebrowser.conf').exists()
assert not (files.roaming_data_dir / 'cache').exists()
assert (files.local_data_dir / 'cache' / 'cachefile').exists()
@pytest.mark.parametrize('args_kind', ['basedir', 'normal', 'none'])