@@ -962,6 +962,7 @@ def appdirs_installed(cls):
962962 def feign_linux (self , monkeypatch ):
963963 monkeypatch .setattr ("platform.system" , lambda : "Linux" )
964964 monkeypatch .setattr ("sys.platform" , "linux" )
965+ monkeypatch .setattr ("os.pathsep" , ":" )
965966 # remove any existing import of appdirs, as it sets up some
966967 # state during import.
967968 sys .modules .pop ('appdirs' )
@@ -1015,6 +1016,20 @@ def test_other_parameters(self):
10151016 res = Path .app_dirs .site .config (multipath = True )
10161017 assert isinstance (res , str )
10171018
1019+ def test_multipath (self , feign_linux , monkeypatch , tmpdir ):
1020+ """
1021+ If multipath is provided, on Linux return the XDG_CONFIG_DIRS
1022+ """
1023+ fake_config_1 = str (tmpdir / '_config1' )
1024+ fake_config_2 = str (tmpdir / '_config2' )
1025+ config_dirs = os .pathsep .join ([fake_config_1 , fake_config_2 ])
1026+ monkeypatch .setitem (os .environ , 'XDG_CONFIG_DIRS' , config_dirs )
1027+ res = Path .app_dirs .site .config (multipath = True )
1028+ assert isinstance (res , Multi )
1029+ assert fake_config_1 in res
1030+ assert fake_config_2 in res
1031+ assert '_config1' in str (res )
1032+
10181033
10191034class TestMultiPath :
10201035 def test_for_class (self ):
0 commit comments