[gvfs] gvfs-test: Robustify MTP test



commit cadb7298c3e55a54889dbf735765f49accfa9c18
Author: Martin Pitt <martinpitt gnome org>
Date:   Thu Nov 7 16:35:17 2013 +0100

    gvfs-test: Robustify MTP test
    
    Don't assume a particular odering of listing the top-level directory.
    
    For unmount success, verify that our Mount object is gone, instead of our URI
    not appearing anywhere in the "gvfs-mount -li" output; the latter catches the
    Volume as well, which we don't expect to go away.

 test/gvfs-test |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/test/gvfs-test b/test/gvfs-test
index 6aab974..7360d53 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -170,7 +170,7 @@ class GvfsTestCase(unittest.TestCase):
         timeout = 5
         while timeout > 0:
             (out, err) = self.program_out_err(['gvfs-mount', '-li'])
-            if uri not in out:
+            if not re.search('Mount.*' + uri, out):
                 break
             timeout -= 1
             time.sleep(1)
@@ -1732,8 +1732,10 @@ class Mtp(GvfsTestCase):
         try:
             # The top-level name is defined by the mobile firmware
             self.assertEqual(self.program_out_success(['gvfs-ls', uri]), 'SD-Karte\n')
-            self.assertEqual(self.program_out_success(['gvfs-ls', uri + '/SD-Karte']),
-                             'DCIM\nhello.txt\nLOST.DIR\nMusic\nAndroid\nclockworkmod\n')
+            out = self.program_out_success(['gvfs-ls', uri + '/SD-Karte'])
+            self.assertIn('DCIM\n', out)
+            self.assertIn('Music\n', out)
+            self.assertIn('hello.txt\n', out)
             self.assertEqual(self.program_out_success(['gvfs-ls', uri + '/SD-Karte/Music']),
                              'GStreamer - The Test Sine\n')
             self.assertEqual(self.program_out_success(['gvfs-ls', uri + '/SD-Karte/Music/GStreamer - The 
Test Sine']),


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