[gvfs] gvfs-test: Skip Dav tests if http is disabled



commit e1aa9e862ea151ba4b73bf982e91ed54b65d8cc6
Author: Martin Pitt <martinpitt gnome org>
Date:   Fri Nov 23 10:16:55 2012 +0100

    gvfs-test: Skip Dav tests if http is disabled
    
    Skip the Dav tests instead of failing when running against the build tree and
    http support is disabled.

 test/gvfs-test |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/test/gvfs-test b/test/gvfs-test
index 6d75e5c..6dbe74e 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -45,6 +45,11 @@ local_ip = subprocess.check_output("ip -4 addr | sed -nr '/127\.0\.0/ n; "
                                    "/inet / {  s/^.*inet ([0-9.]+).*$/\\1/; p; q  }'",
                                    shell=True, universal_newlines=True)
 
+# when running in the build tree, check whether Dav backend is enabled
+have_dav_backend = True
+if 'GVFS_MOUNTABLE_DIR' in os.environ:
+    have_dav_backend = os.path.exists(os.path.join(os.environ['GVFS_MOUNTABLE_DIR'], 'dav.localmount'))
+
 my_dir = os.path.dirname(os.path.abspath(__file__))
 
 # we need this flag to check if we can test error messages
@@ -1078,6 +1083,7 @@ pkill --signal HUP udevd || pkill --signal HUP systemd-udevd
             self.mock_polkit = None
 
 @unittest.skipUnless(have_httpd, 'Apache httpd not installed')
+ unittest skipUnless(have_dav_backend, 'Dav backend not enabled')
 class Dav(GvfsTestCase):
     '''Test WebDAV backend'''
 



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