Skip to content

Commit f7a5c95

Browse files
authored
Merge pull request #491 from QuLogic/fix-linux-userpath
Fix Linux user path test
2 parents 5b039e6 + d7d7ec0 commit f7a5c95

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

libpysal/examples/tests/test_available.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ def test_data_home(self):
2323
head, tail = os.path.split(pth)
2424
self.assertEqual(tail, "pysal")
2525
if os_name == "Linux":
26-
heads = head.split("/")
27-
self.assertEqual(heads[1], "home")
28-
self.assertEqual(heads[-1], "share")
29-
self.assertEqual(heads[-2], ".local")
26+
if "XDG_DATA_HOME" in os.environ:
27+
self.assertEqual(head, os.environ["XDG_DATA_HOME"])
28+
else:
29+
heads = head.split("/")
30+
self.assertEqual(heads[-1], "share")
31+
self.assertEqual(heads[-2], ".local")
3032
elif os_name == "Darwin":
3133
heads = head.split("/")
3234
self.assertEqual(heads[1], "Users")

0 commit comments

Comments
 (0)