[pygobject] test_glib: Drop some assumptions about XDG dirs



commit c3b2f5fee573aa03a8a9563efbbbc1bc4fa25da7
Author: Martin Pitt <martinpitt gnome org>
Date:   Thu Nov 29 09:29:05 2012 +0100

    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.

 tests/test_glib.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/tests/test_glib.py b/tests/test_glib.py
index 1a45fd8..5feae1f 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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]