summaryrefslogtreecommitdiff
path: root/tests/test_glib.py
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2012-11-29 09:29:05 +0100
committerMartin Pitt <martinpitt@gnome.org>2012-11-29 09:29:05 +0100
commitc3b2f5fee573aa03a8a9563efbbbc1bc4fa25da7 (patch)
tree708ef9040b1f003b82aa1fcad8f318005738fbb3 /tests/test_glib.py
parente45c690bc83b6d513887649de88965a9752e316d (diff)
downloadpygobject-c3b2f5fee573aa03a8a9563efbbbc1bc4fa25da7.tar.gz
test_glib: Drop some assumptions about XDG dirs
Some directories do not exist in minimal test environments, and this is not important for testing that calling these GLib functions works.
Diffstat (limited to 'tests/test_glib.py')
-rw-r--r--tests/test_glib.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_glib.py b/tests/test_glib.py
index 1a45fd8b..5feae1f5 100644
--- a/tests/test_glib.py
+++ b/tests/test_glib.py
@@ -36,8 +36,10 @@ class TestGLib(unittest.TestCase):
self.assertEqual(GLib.get_application_name(), 'moo')
def test_xdg_dirs(self):
- self.assertTrue(os.path.isdir(GLib.get_user_data_dir()))
- self.assertTrue(os.path.isdir(GLib.get_user_special_dir(GLib.USER_DIRECTORY_DESKTOP)))
+ d = GLib.get_user_data_dir()
+ self.assertTrue('/' in d, d)
+ d = GLib.get_user_special_dir(GLib.USER_DIRECTORY_DESKTOP)
+ self.assertTrue('/' in d, d)
# also works with backwards compatible enum names
self.assertEqual(GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_MUSIC),
GLib.get_user_special_dir(GLib.USER_DIRECTORY_MUSIC))
@@ -45,7 +47,7 @@ class TestGLib(unittest.TestCase):
for d in GLib.get_system_config_dirs():
self.assertTrue('/' in d, d)
for d in GLib.get_system_data_dirs():
- self.assertTrue('/' in d, d)
+ self.assertTrue(isinstance(d, str), d)
def test_main_depth(self):
self.assertEqual(GLib.main_depth(), 0)