[gvfs] test: Support /tmp on the same partition as test home



commit 5a4cc41acbf026fd640e16f6323482fb366bfb19
Author: Ross Lagerwall <rosslagerwall gmail com>
Date:   Sun Feb 1 23:43:24 2015 +0000

    test: Support /tmp on the same partition as test home
    
    Fix a test failure in test_file_in_system where it fails if /tmp is the
    same partition as $XDG_DATA_HOME by looking in a different place for the
    trashed item.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743820

 test/gvfs-test |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/test/gvfs-test b/test/gvfs-test
index ef39e03..715d90c 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -1673,8 +1673,12 @@ class Trash(GvfsTestCase):
 
         if trash.returncode == 0:
             self.assertFalse(os.path.exists(self.my_file))
-            self.assertTrue(os.path.exists('/tmp/.Trash-%i/files/hello_gvfs_tests.txt'
-                                           % os.getuid()))
+            if os.stat('/tmp').st_dev == os.stat(os.environ['XDG_DATA_HOME']).st_dev:
+                self.assertTrue(os.path.exists(os.path.join(os.environ['XDG_DATA_HOME'],
+                                                            'Trash/files/hello_gvfs_tests.txt')))
+            else:
+                self.assertTrue(os.path.exists('/tmp/.Trash-%i/files/hello_gvfs_tests.txt'
+                                               % os.getuid()))
         else:
             # file should still be there
             self.assertTrue(os.path.exists(self.my_file))


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