@pytest.mark.usefixtures('reset_standarddir')
@pytest.mark.parametrize('data_subdir, config_subdir, expected', [('foo', 'foo', 'foo/data'), ('foo', 'bar', 'foo')])
def test_get_fake_windows_equal_dir(data_subdir, config_subdir, expected, monkeypatch, tmpdir):
 locations = {QStandardPaths.DataLocation: str((tmpdir / data_subdir)), QStandardPaths.ConfigLocation: str((tmpdir / config_subdir))}
 monkeypatch.setattr('qutebrowser.utils.standarddir.os.name', 'nt')
 monkeypatch.setattr('qutebrowser.utils.standarddir.QStandardPaths.writableLocation', locations.get)
 expected = str((tmpdir / expected))
 assert (standarddir.data() == expected)

@ pytest . mark . usefixtures ( 'reset_standarddir' ) @ pytest . mark . parametrize ( 'data_subdir, config_subdir, expected' , [ ( 'foo' , 'foo' , 'foo/data' ) , ( 'foo' , 'bar' , 'foo' ) ] ) def test_get_fake_windows_equal_dir ( data_subdir , config_subdir , expected , monkeypatch , tmpdir ) : locations = { QStandardPaths . DataLocation : str ( ( tmpdir / data_subdir ) ) , QStandardPaths . ConfigLocation : str ( ( tmpdir / config_subdir ) ) } monkeypatch . setattr ( 'qutebrowser.utils.standarddir.os.name' , 'nt' ) monkeypatch . setattr ( 'qutebrowser.utils.standarddir.QStandardPaths.writableLocation' , locations . get ) expected = str ( ( tmpdir / expected ) ) assert ( standarddir . data ( ) == expected )
test _get with a fake windows os with equal data/config dirs .