def test_fake_windows(tmpdir, monkeypatch, what): """Make sure the config/data/cache dirs are correct on a fake Windows.""" monkeypatch.setattr(standarddir.QStandardPaths, 'writableLocation', lambda typ: str(tmpdir / APPNAME)) standarddir._init_config(args=None) standarddir._init_data(args=None) standarddir._init_cache(args=None) func = getattr(standarddir, what) assert func() == str(tmpdir / APPNAME / what)
def test_fake_windows(tmpdir, monkeypatch, what): """Make sure the config/data/cache dirs are correct on a fake Windows.""" monkeypatch.setattr(standarddir.QStandardPaths, 'writableLocation', lambda typ: str(tmpdir / APPNAME)) standarddir._init_config(args=None) standarddir._init_data(args=None) standarddir._init_cache(args=None) func = getattr(standarddir, what) assert func() == str(tmpdir / APPNAME / what)