[gvfs] test: Skip sftp tests if ssh key is not available



commit 7f093223b626489b41a76f396a2f9eafc5ddbb43
Author: Ondrej Holy <oholy redhat com>
Date:   Fri Jun 3 16:49:41 2016 +0200

    test: Skip sftp tests if ssh key is not available
    
    Currently sftp tests fail if ~/.ssh/id_rsa is not available with
    the following error:
    AssertionError: False is not true : This test needs an existing ~/.ssh/id_rsa
    
    Sftp tests should be skipped if the key is not found to avoid test
    suite failures.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734370

 test/gvfs-test |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/test/gvfs-test b/test/gvfs-test
index fbaebbc..d180d9a 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -447,15 +447,13 @@ class ArchiveMounter(GvfsTestCase):
 
 
 @unittest.skipUnless(os.getenv('XDG_RUNTIME_DIR'), 'No $XDG_RUNTIME_DIR available')
+ unittest skipUnless(os.path.exists(os.path.expanduser('~/.ssh/id_rsa')), 'This test needs an existing 
~/.ssh/id_rsa')
 class Sftp(GvfsTestCase):
     def setUp(self):
         '''Run ssh server'''
 
         super().setUp()
 
-        self.assertTrue(os.path.exists(os.path.expanduser('~/.ssh/id_rsa')),
-                        'This test needs an existing ~/.ssh/id_rsa')
-
         # find sftp-server
         for dir in ['/usr/local/lib/openssh',
                     '/usr/lib/openssh',


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