changeset 861:4d091738275c

test: skip radiocol tests if the sound samples are not found
author souliane <souliane@mailoo.org>
date Mon, 24 Feb 2014 12:57:56 +0100
parents 2b98f5631fba
children ca7a2bf4fb40
files src/test/test_plugin_misc_radiocol.py
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/test/test_plugin_misc_radiocol.py	Mon Feb 24 12:21:59 2014 +0100
+++ b/src/test/test_plugin_misc_radiocol.py	Mon Feb 24 12:57:56 2014 +0100
@@ -32,6 +32,7 @@
 from twisted.internet import reactor
 from twisted.internet import defer
 from twisted.python.failure import Failure
+from twisted.trial.unittest import SkipTest
 
 from mutagen.oggvorbis import OggVorbis
 
@@ -70,9 +71,12 @@
         self.songs = []
         self.playlist = []
         self.sound_dir = self.host.memory.getConfig('', 'media_dir') + '/test/sound/'
-        for filename in os.listdir(self.sound_dir):
-            if filename.endswith('.ogg'):
-                self.songs.append(filename)
+        try:
+            for filename in os.listdir(self.sound_dir):
+                if filename.endswith('.ogg'):
+                    self.songs.append(filename)
+        except OSError:
+            raise SkipTest('The sound samples in sat_media/test/sound were not found')
 
     def _buildPlayers(self, players=[]):
         """@return: the "started" content built with the given players"""