File tree 3 files changed +12
-12
lines changed
data/user_dirs/AppData/Roaming/openeo-python-client 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 11
11
# Make tests more predictable and avoid loading real configs in tests.
12
12
os .environ ["XDG_CONFIG_HOME" ] = str (Path (__file__ ).parent / "data/user_dirs/config" )
13
13
os .environ ["XDG_DATA_HOME" ] = str (Path (__file__ ).parent / "data/user_dirs/data" )
14
+ # Windows does not use the *nix environment variables XDG_CONFIG_HOME and XDG_DATA_HOME
15
+ # It has only one corresponding folder for both config and data: APPDATA
16
+ os .environ ["APPDATA" ] = str (Path (__file__ ).parent / "data/user_dirs/AppData/Roaming" )
14
17
15
18
16
19
@pytest .fixture
Original file line number Diff line number Diff line change
1
+ *
Original file line number Diff line number Diff line change 16
16
17
17
18
18
def test_get_user_config_dir ():
19
- # For Linux/Mac we configure the config and data directories in conftest.py
20
- # via the environment variables XDG_CONFIG_HOME and XDG_DATA_HOME.
21
- # But on Windows we need to set APPDATA instead, and we don't have separate
22
- # variables for config and data.
23
19
if platform .system () == "Windows" :
24
- os .environ ["APPDATA" ] = str (Path (__file__ ).parent / "data/user_dirs/config" )
25
- assert get_user_config_dir () == Path (__file__ ).parent / "data/user_dirs/config/openeo-python-client"
20
+ expected = Path (__file__ ).parent / "data/user_dirs/AppData/Roaming/openeo-python-client"
21
+ else :
22
+ expected = Path (__file__ ).parent / "data/user_dirs/config/openeo-python-client"
23
+ assert get_user_config_dir () == expected
26
24
27
25
28
26
def test_get_user_data_dir ():
29
- # For Linux/Mac we configure the config and data directories in conftest.py
30
- # via the environment variables XDG_CONFIG_HOME and XDG_DATA_HOME.
31
- # But on Windows we need to set APPDATA instead, and we don't have separate
32
- # variables for config and data.
33
27
if platform .system () == "Windows" :
34
- os .environ ["APPDATA" ] = str (Path (__file__ ).parent / "data/user_dirs/data" )
35
- assert get_user_data_dir () == Path (__file__ ).parent / "data/user_dirs/data/openeo-python-client"
28
+ expected = Path (__file__ ).parent / "data/user_dirs/AppData/Roaming/openeo-python-client"
29
+ else :
30
+ expected = Path (__file__ ).parent / "data/user_dirs/data/openeo-python-client"
31
+ assert get_user_data_dir () == expected
36
32
37
33
38
34
class TestClientConfig :
You can’t perform that action at this time.
0 commit comments