[gvfs] test: Skip ftp tests if twistd is not installed



commit 426f1d526579ce32d57f95eb3e7578cabcbd1fda
Author: Ondrej Holy <oholy redhat com>
Date:   Mon May 30 10:19:36 2016 +0200

    test: Skip ftp tests if twistd is not installed
    
    Currently ftp tests fail if twistd is not installed with the following
    error:
    FileNotFoundError: [Errno 2] No such file or directory: 'twistd'
    
    Sftp tests should be skipped if twistd is not installed to avoid test
    suite failures.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734370

 test/gvfs-test |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/test/gvfs-test b/test/gvfs-test
index 86ed611..d9c4593 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -50,6 +50,7 @@ except ImportError:
 # umockdev environment for gphoto/MTP tests
 umockdev_testbed = None
 
+have_twistd = subprocess.call(['which', 'twistd'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0
 
 def find_alternative(cmds):
     '''Find command in cmds array and return the found alternative'''
@@ -564,6 +565,7 @@ Subsystem sftp %(sftp_server)s
             self.unmount(uri)
 
 
+ unittest skipUnless(have_twistd, 'Twisted twistd not installed')
 class Ftp(GvfsTestCase):
     def setUp(self):
         '''Launch FTP server'''


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