summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-11-07 16:35:17 +0100
committerMartin Pitt <martinpitt@gnome.org>2013-11-07 16:35:17 +0100
commitcadb7298c3e55a54889dbf735765f49accfa9c18 (patch)
treef0f48a2d8c6c0ad861e76345d1804d59b0249f6b
parentd76dce9e83ddc033b53d2603b4f4d9f73de1f112 (diff)
downloadgvfs-cadb7298c3e55a54889dbf735765f49accfa9c18.tar.gz
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.
-rwxr-xr-xtest/gvfs-test8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/gvfs-test b/test/gvfs-test
index 6aab9743..7360d539 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']),