diff options
author | Martin Pitt <martinpitt@gnome.org> | 2013-11-07 16:35:17 +0100 |
---|---|---|
committer | Martin Pitt <martinpitt@gnome.org> | 2013-11-07 16:35:17 +0100 |
commit | cadb7298c3e55a54889dbf735765f49accfa9c18 (patch) | |
tree | f0f48a2d8c6c0ad861e76345d1804d59b0249f6b | |
parent | d76dce9e83ddc033b53d2603b4f4d9f73de1f112 (diff) | |
download | gvfs-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-x | test/gvfs-test | 8 |
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']), |